-
Notifications
You must be signed in to change notification settings - Fork 2
/
endpoint_manifest_schema.json
139 lines (139 loc) · 5.19 KB
/
endpoint_manifest_schema.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
{
"$id": "https://restate.dev/endpoint.manifest.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Endpoint",
"description": "Restate endpoint manifest v1",
"properties": {
"protocolMode": {
"title": "ProtocolMode",
"enum": ["BIDI_STREAM", "REQUEST_RESPONSE"]
},
"minProtocolVersion": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647,
"description": "Minimum supported protocol version"
},
"maxProtocolVersion": {
"type": "integer",
"minimum": 1,
"maximum": 2147483647,
"description": "Maximum supported protocol version"
},
"services": {
"type": "array",
"items": {
"type": "object",
"title": "Service",
"properties": {
"name": {
"type": "string",
"pattern": "^([a-zA-Z]|_[a-zA-Z0-9])[a-zA-Z0-9._-]*$"
},
"ty": {
"title": "ServiceType",
"enum": ["VIRTUAL_OBJECT", "SERVICE", "WORKFLOW"]
},
"handlers": {
"type": "array",
"items": {
"type": "object",
"title": "Handler",
"properties": {
"name": {
"type": "string",
"pattern": "^([a-zA-Z]|_[a-zA-Z0-9])[a-zA-Z0-9_]*$"
},
"ty": {
"title": "HandlerType",
"enum": ["WORKFLOW", "EXCLUSIVE", "SHARED"],
"description": "If unspecified, defaults to EXCLUSIVE for Virtual Object or WORKFLOW for Workflows. This should be unset for Services."
},
"input": {
"type": "object",
"title": "InputPayload",
"description": "Description of an input payload. This will be used by Restate to validate incoming requests.",
"properties": {
"required": {
"type": "boolean",
"description": "If true, a body MUST be sent with a content-type, even if the body length is zero."
},
"contentType": {
"type": "string",
"description": "Content type of the input. It can accept wildcards, in the same format as the 'Accept' header. When this field is unset, it implies emptiness, meaning no content-type/body is expected."
},
"jsonSchema": {}
},
"additionalProperties": false,
"default": {
"contentType": "*/*",
"required": false
},
"examples": {
"empty input": {},
"non empty json input": {
"required": true,
"contentType": "application/json",
"jsonSchema": true
},
"either empty or non empty json input": {
"required": false,
"contentType": "application/json",
"jsonSchema": true
},
"bytes input": {
"required": true,
"contentType": "application/octet-stream"
}
}
},
"output": {
"type": "object",
"title": "OutputPayload",
"description": "Description of an output payload.",
"properties": {
"contentType": {
"type": "string",
"description": "Content type set on output. This will be used by Restate to set the output content type at the ingress."
},
"setContentTypeIfEmpty": {
"type": "boolean",
"description": "If true, the specified content-type is set even if the output is empty."
},
"jsonSchema": {}
},
"additionalProperties": false,
"default": {
"contentType": "application/json",
"setContentTypeIfEmpty": false
},
"examples": {
"empty output": {
"setContentTypeIfEmpty": false
},
"non-empty json output": {
"contentType": "application/json",
"setContentTypeIfEmpty": false,
"jsonSchema": true
},
"protobuf output": {
"contentType": "application/proto",
"setContentTypeIfEmpty": true
}
}
}
},
"required": ["name"],
"additionalProperties": false
}
}
},
"required": ["name", "ty", "handlers"],
"additionalProperties": false
}
}
},
"required": ["minProtocolVersion", "maxProtocolVersion", "services"],
"additionalProperties": false
}