Open leofvo opened 1 month ago
The changes introduce a new configuration option expose_openapi: false
in the example.config.yaml
file, which controls whether the OpenAPI specification is exposed by the HTTP server. Corresponding modifications in internal/config/config.go
add a boolean field ExposeOpenAPI
to the HTTP
struct, defaulting to false
. The internal/servers/server.go
file is updated to implement a new HTTP multiplexer, conditionally registering the OpenAPI endpoint based on the ExposeOpenAPI
configuration.
File Path | Change Summary |
---|---|
example.config.yaml | Added configuration option: expose_openapi: false in the server section. |
internal/config/config.go | Added field: ExposeOpenAPI bool in HTTP struct; default value set to false . |
internal/servers/server.go | Introduced grpcMux and httpMux variables; updated HTTP server to conditionally register OpenAPI endpoint. |
Objective | Addressed | Explanation |
---|---|---|
Add an endpoint to expose openapi (Issue #1714) | ❌ | The endpoint for exposing OpenAPI is not implemented. |
🐰 In the garden, I hop and play,
New configs bloom, bright as day.
OpenAPI hides, but not for long,
Soon it’ll sing its JSON song!
Withexpose_openapi
, we’ll find our way,
To share our specs, hip-hip-hooray! 🌼
Adding an http endpoint to expose the openapi.json file http://hostname:port/openapi.json
Also allow to enable the exposition or not using the config, not exposed by default to keep the actual behavior.
If you need to expose your openAPI, you can add the following configuration:
close #1714
Summary by CodeRabbit
New Features
Bug Fixes
Documentation