Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add metadata and documentation fields in service and handler definitions #98

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dev/restate/service/discovery.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@ enum ServiceDiscoveryProtocolVersion {
SERVICE_DISCOVERY_PROTOCOL_VERSION_UNSPECIFIED = 0;
// initial service discovery protocol version using endpoint_manifest_schema.json
V1 = 1;
// add custom metadata and documentation for services/handlers
V2 = 2;
}
57 changes: 50 additions & 7 deletions endpoint_manifest_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"title": "Endpoint",
"description": "Restate endpoint manifest v1",
"description": "Restate endpoint manifest v2",
"properties": {
"protocolMode": {
"title": "ProtocolMode",
"enum": ["BIDI_STREAM", "REQUEST_RESPONSE"]
"enum": [
"BIDI_STREAM",
"REQUEST_RESPONSE"
]
},
"minProtocolVersion": {
"type": "integer",
Expand All @@ -31,9 +34,17 @@
"type": "string",
"pattern": "^([a-zA-Z]|_[a-zA-Z0-9])[a-zA-Z0-9._-]*$"
},
"documentation": {
"type": "string",
"description": "Documentation for this service definition. No format is enforced, but generally Markdown is assumed."
},
"ty": {
"title": "ServiceType",
"enum": ["VIRTUAL_OBJECT", "SERVICE", "WORKFLOW"]
"enum": [
"VIRTUAL_OBJECT",
"SERVICE",
"WORKFLOW"
]
},
"handlers": {
"type": "array",
Expand All @@ -45,9 +56,17 @@
"type": "string",
"pattern": "^([a-zA-Z]|_[a-zA-Z0-9])[a-zA-Z0-9_]*$"
},
"documentation": {
"type": "string",
"description": "Documentation for this handler definition. No format is enforced, but generally Markdown is assumed."
},
"ty": {
"title": "HandlerType",
"enum": ["WORKFLOW", "EXCLUSIVE", "SHARED"],
"enum": [
"WORKFLOW",
"EXCLUSIVE",
"SHARED"
],
"description": "If unspecified, defaults to EXCLUSIVE for Virtual Object or WORKFLOW for Workflows. This should be unset for Services."
},
"input": {
Expand Down Expand Up @@ -122,18 +141,42 @@
"setContentTypeIfEmpty": true
}
}
},
"metadata": {
"type": "object",
"description": "Custom metadata of this handler definition. This metadata is shown on the Admin API when querying the service/handler definition.",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["name"],
"required": [
"name"
],
"additionalProperties": false
}
},
"metadata": {
"type": "object",
"description": "Custom metadata of this service definition. This metadata is shown on the Admin API when querying the service definition.",
"additionalProperties": {
"type": "string"
}
}
},
"required": ["name", "ty", "handlers"],
"required": [
"name",
"ty",
"handlers"
],
"additionalProperties": false
}
}
},
"required": ["minProtocolVersion", "maxProtocolVersion", "services"],
"required": [
"minProtocolVersion",
"maxProtocolVersion",
"services"
],
"additionalProperties": false
}
Loading