@@ -37,6 +37,8 @@ const (
37
37
// FunctionTypeCustom property defines a list of function types that are set by the specification. Some runtime
38
38
// implementations might support additional function types that extend the ones defined in the specification
39
39
FunctionTypeCustom FunctionType = "custom"
40
+ // FunctionTypeHttp defines a https://datatracker.ietf.org/doc/html/rfc2616#page-36 as the operation input
41
+ FunctionTypeHttp FunctionType = "http"
40
42
)
41
43
42
44
// FunctionType ...
@@ -51,13 +53,16 @@ func (i FunctionType) KindValues() []string {
51
53
string (FunctionTypeAsyncAPI ),
52
54
string (FunctionTypeOData ),
53
55
string (FunctionTypeCustom ),
56
+ string (FunctionTypeHttp ),
54
57
}
55
58
}
56
59
57
60
func (i FunctionType ) String () string {
58
61
return string (i )
59
62
}
60
63
64
+ type FunctionOperation any
65
+
61
66
// Function ...
62
67
// +builder-gen:new-call=ApplyDefault
63
68
type Function struct {
@@ -70,8 +75,16 @@ type Function struct {
70
75
// If type is `expression`, defines the workflow expression. If the type is `custom`,
71
76
// <path_to_custom_script>#<custom_service_method>.
72
77
// +kubebuilder:validation:Required
73
- Operation string `json:"operation" validate:"required"`
74
- // Defines the function type. Is either `custom`, `rest`, `rpc`, `expression`, `graphql`, `odata` or `asyncapi`.
78
+ // If type is `http`, provide the http requst object. https://datatracker.ietf.org/doc/html/rfc2616#page-36
79
+ // {
80
+ // "method": "POST",
81
+ // "uri": "https://petstore.swagger.io/v2/pet/",
82
+ // "headers": {
83
+ // "Content-Type": "application/json"
84
+ // }
85
+ // }
86
+ Operation FunctionOperation `json:"operation" validate:"required"`
87
+ // Defines the function type. Is either `custom`, `rest`, `rpc`, `expression`, `graphql`, `odata` or `asyncapi` or `http`.
75
88
// Default is `rest`.
76
89
// +kubebuilder:validation:Enum=rest;rpc;expression;graphql;odata;asyncapi;custom
77
90
// +kubebuilder:default=rest
0 commit comments