-
Notifications
You must be signed in to change notification settings - Fork 4
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
docs(openapi): Proposal for better OpenAPI definitions #242
docs(openapi): Proposal for better OpenAPI definitions #242
Conversation
In proto, a zero value with the `[TYPE]_UNSPECIFIED` name is required for all enums. In OpenAPI, however, this isn't required and only adds verbosity. Outputting these values is disabled until a case is found where the zero value can be returned or carries meaning.
The visibility option is used to hide endpoints from the OpenAPI output. They will start having visibility as they are aligned with the documentation template provided in the following commits.
a7eeec8
to
adf4283
Compare
The base-level information of the OpenAPI document must contain a license field if we want to apply linting to the document.
2fc6da8
to
a183c7e
Compare
7f5c6fe
to
47b6025
Compare
When a pull request is created, a GHA workflow will generate the OpenAPI definitions, which will be linted and pushed to the source branch if anything in the definition has changed. fix
The OpenAPI definitions for endpoints that haven't been corrected yet are still useful, though maybe not ready for public visibility. An internal OpenAPI document is generated to preserve these definitions.
fcf8a5d
to
abe45ec
Compare
triggered by commit: efe933a
The PR looks good to me.
The API endpoints should be exposed from the gateway perspective. So in my understanding, there are two approaches
I think three OpenAI document is fine for beta. Not sure what does @pinglin and @xiaofei-du think BTW, we are planning to make our OpenAPI document hosted by https://readme.com/ . |
I do agree, but then all the I'll have a quick look at how to modify the public endpoints' base path. If there's no straightforward solution, I agree this is good enough for beta 🤝 . |
Because
This PR
INTERNAL
.openapiv2/internal
.vdp.pipeline.v1beta.PipelinePrivateService
proto definition as a proposal for an OpenAPI document template.Notes and questions
/vdp
,/internal
,/core
, etc., so I doubt these definitions can be direclty transformed to cURL request (or that working code can be generated from them).buf generate --path {}
, but it will change how we render the definitions. Something to keep in mind for the future, probably for beta this is enough.pipelinePermalink
becomespipelines/permalink
). I think this approach makes the proto -> openAPI translation unclear(er), hiding behind some undocumented rules. Therefore, I only used whatgoogleapis
andgprc-gateway
provide.Old vs new documentation
Generated with
redocly preview-docs
:Old 👺
New 👶