Add /openapi ingress route to serve a merged OpenAPI spec#4538
Open
igalshilman wants to merge 1 commit intorestatedev:mainfrom
Open
Add /openapi ingress route to serve a merged OpenAPI spec#4538igalshilman wants to merge 1 commit intorestatedev:mainfrom
igalshilman wants to merge 1 commit intorestatedev:mainfrom
Conversation
573541d to 7f3b687 Compare 7f3b687 to bd5eb59 Compare Implements restatedev#3108. The ingress /openapi endpoint (previously stubbed as NotImplemented) now returns a merged OpenAPI 3.1 spec combining all registered services. Schema component names, $ref pointers, and JSON Schema titles (when present) are all aligned between per-service and merged specs using PascalCase naming with a service-level prefix. Examples: service "greeter", handler "greet" -> GreeterGreetRequest / GreeterGreetResponse service "concurrent_greeter", handler "claude_sonnet" -> ConcurrentGreeterClaudeSonnetRequest The prefix can be overridden via the "dev.restate.openapi.prefix" metadata key, which can be set at both the service and handler level. Handler-level takes precedence over service-level. Examples with metadata: service metadata: dev.restate.openapi.prefix = "Payments" -> PaymentsProcessRequest (instead of PaymentServiceProcessRequest) handler metadata: dev.restate.openapi.prefix = "Checkout" -> CheckoutProcessRequest (overrides service prefix for that handler) When set at the service level, the prefix is also used as the per-service OpenAPI spec title.
bd5eb59 to 797269b Compare This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support /openapi on the ingress to serve a merged OpenAPI spec
Implements #3108.
The ingress /openapi endpoint (previously stubbed as NotImplemented)
now returns a merged OpenAPI 3.1 spec combining all registered services.
Schema component names, $ref pointers, and JSON Schema titles (when
present) are all aligned between per-service and merged specs using
PascalCase naming with a service-level prefix.
Examples:
service "greeter", handler "greet"
-> GreeterGreetRequest / GreeterGreetResponse
The prefix can be overridden via the "dev.restate.openapi.prefix"
metadata key, which can be set at both the service and handler level.
Handler-level takes precedence over service-level.
Examples with metadata:
service metadata: dev.restate.openapi.prefix = "Payments"
-> PaymentsProcessRequest (instead of PaymentServiceProcessRequest)
When set at the service level, the prefix is also used as the
per-service OpenAPI spec title.