-
Notifications
You must be signed in to change notification settings - Fork 254
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
protoc-gen-openapi: add flag to generate source_relative yaml #359
protoc-gen-openapi: add flag to generate source_relative yaml #359
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
2fe8555
to
395e74b
Compare
Looking forward to this! |
Nice PR |
Hi @timburks could you please take a look and start a first round of review? That PR proved pretty useful, if you host multiple APIs in the same monorepo. |
@gfelbing @nightlyone I'm open to merging this, but as I've mentioned elsewhere, this isn't how the APIs in github.com/googleapis/googleapis are structured (which I'm most familiar with). Could we get a simple set of protos (two or three) that illustrate how you're expecting this to work? (I'm guessing each .proto is a complete API). Then we can add a few tests to help us maintain this. Thanks! |
Hi @timburks !
With the following
|
286f592
to
31ec2f7
Compare
Hi @timburks ! I was able to reuse the existing test cases: If we run the generator with the source_relative option on all examples at once, we can assert equality to the result of the single execution. |
Watching 👍 |
I have an idea about the pr, maybe you can consider same directory protobuf files generate one openapi file.
=> use
Maybe same directory proto files can generate one openapi yaml/json file. Thank you for sharing so excellent tool! |
03d73da
to
422fa65
Compare
@li1234yun Thanks for your suggestion! @timburks thanks for updating the feature branch! I fixed the tests again, there were some c/p issues in the new test data. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gfelbing thanks for adding this and the extra tests! @li1234yun, I think the suggestion to support a different output mode seems workable considering how localized the changes would be in generator.go
. Followup PRs would be welcome.
In Monorepos, merging all proto files into a single openapi.yaml isn't useful.
This PR adds a flag for separating generated openapi.yaml files for each proto file.
Fixes #268