fix(openapi): improve openapi generation#5823
Conversation
|
👋 Hi @erka! Thanks for your contribution to this project. It looks like one or more of your commits are missing a DCO (Developer Certificate of Origin) sign-off. The DCO is a simple way for you to certify that you have the right to submit this code under the project's license. How to fix this: # For future commits, use the -s flag
git commit -s -m "Your commit message"
# To sign off on existing commits in this PR
git rebase HEAD~$(git rev-list --count origin/v2..HEAD) --signoff
git push --force-with-leaseThe 📋 View the failing DCO check for more details For more information about the DCO, visit: https://developercertificate.org/ |
|
The latest Buf updates on your PR. Results from workflow Proto / proto-lint (pull_request).
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## v2 #5823 +/- ##
=======================================
Coverage 61.19% 61.19%
=======================================
Files 141 141
Lines 14195 14195
=======================================
Hits 8686 8686
Misses 4777 4777
Partials 732 732
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c74a6bb to
a987ab7
Compare
Signed-off-by: Roman Dmytrenko <[email protected]>
| } | ||
|
|
||
| rpc Schema(google.protobuf.Empty) returns (SchemaAnchor) { | ||
| option (google.api.http) = {get: "/api/v2/_payloadschema"}; |
There was a problem hiding this comment.
is this a standard in openapi or something?
There was a problem hiding this comment.
no, this is workaround for gnostic. By default it only generate openapi schema for objects which are in use in protobuf so I have to fake it in such ugly way to get them into the openapi schema. Saying that.. maybe there is a better way as I've ended up with custom buf plugin.
markphelps
left a comment
There was a problem hiding this comment.
thank you @erka ! just one question but non-blocking. lgtm
A better workaround for #5823 without dirty things in Flipt GRPC. Signed-off-by: Roman Dmytrenko <[email protected]>
A better workaround for #5823 without dirty things in Flipt GRPC. Signed-off-by: Roman Dmytrenko <[email protected]>
A better workaround for #5823 without dirty things in Flipt GRPC. Signed-off-by: Roman Dmytrenko <[email protected]>
This PR adds a custom OpenAPI generator (protoc-gen-flipt-openapi) that modifies the standard gnostic OpenAPI generator to support Flipt's Resource Payload pattern.
Why
The standard gnostic generator outputs
google.protobuf.Anyschemas, but Flipt's Resource API uses polymorphic payloads with a @type discriminator. This custom generator: