-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix: required properties of message type are required in OpenAPI #2904
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
fix: required properties of message type are required in OpenAPI #2904
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. |
Would love to see this merged! @gostajonasson -- I added a few tests (in my fork) to verify your change, and I think you have the right fix.
Feel free to copy anything from my fork if it helps to get your PR merged :) |
Huh, this is a surprisingly small fix. I can't say I know why that check was there. @MakDon what do you think about the changes? You've contributed a fix in this space recently. |
I will take a look at it ASAP :D |
Thanks @keyz! |
More tests shouldn't hurt, so please feel free to add them here. Thanks @MakDon for taking a look! |
Yes you are correct @MakDon, this PR is naive and I need help fixing it.
Which isn't recommended since other members than But I'm also seeing that the Personally I think that the best fix is outside of the
|
5870b53
to
d3eab36
Compare
Hi @gostajonasson, thanks again for working on this, do you think you'll bring this over the line in the next week or so? I'm just planning out the next release timing. Thanks! |
@johanbrandhorst Yes I hope so! Sorry for the delay. |
@keyz Do you think I should add everything from the two commits you linked to? |
@gostajonasson you can:
|
61a3894
to
1547c87
Compare
@keyz Thanks for the instructions! I've followed them and pushed the changes. Happy for a review and a workflow run. 🤗 |
1547c87
to
ca03173
Compare
ca03173
to
81c7453
Compare
81c7453
to
db42d76
Compare
Thanks for your contribution! |
https://github.com/grpc-ecosystem/grpc-gateway/releases/tag/v2.12.0 has been released |
) [](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [github.com/grpc-ecosystem/grpc-gateway/v2](https://togithub.com/grpc-ecosystem/grpc-gateway) | require | minor | `v2.11.3` -> `v2.13.0` | --- ### Release Notes <details> <summary>grpc-ecosystem/grpc-gateway</summary> ### [`v2.13.0`](https://togithub.com/grpc-ecosystem/grpc-gateway/releases/tag/v2.13.0) [Compare Source](https://togithub.com/grpc-ecosystem/grpc-gateway/compare/v2.12.0...v2.13.0) #### What's Changed - Updated gRPC code Cancelled replaced with HTTP code 499 by [@​tech-sumit](https://togithub.com/tech-sumit) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2957](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2957) - fix: remove default service tag generation for methods by [@​kkolur](https://togithub.com/kkolur) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2960](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2960) - Use tag instead of has pin for SLSA generator by [@​laurentsimon](https://togithub.com/laurentsimon) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2969](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2969) - Add Conduit to adopters by [@​hariso](https://togithub.com/hariso) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2981](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2981) - feat(gen-openapiv2): support trailing comments by [@​ionling](https://togithub.com/ionling) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2965](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2965) - feat(gen-openapiv2): keep fields next to "$ref" fields by [@​gostajonasson](https://togithub.com/gostajonasson) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2986](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2986) #### New Contributors - [@​tech-sumit](https://togithub.com/tech-sumit) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2957](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2957) - [@​hariso](https://togithub.com/hariso) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2981](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2981) - [@​ionling](https://togithub.com/ionling) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2965](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2965) **Full Changelog**: grpc-ecosystem/grpc-gateway@v2.12.0...v2.13.0 ### [`v2.12.0`](https://togithub.com/grpc-ecosystem/grpc-gateway/releases/tag/v2.12.0) [Compare Source](https://togithub.com/grpc-ecosystem/grpc-gateway/compare/v2.11.3...v2.12.0) #### What's Changed - fix: support for oneof fields in request bodies by [@​isbang](https://togithub.com/isbang) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2867](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2867) - mux: calculate verb correctly for cases like DELETE /foo/bar:archive when user provided wrong method by [@​jonathaningram](https://togithub.com/jonathaningram) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2870](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2870) - Update googleapis dependency by [@​johanbrandhorst](https://togithub.com/johanbrandhorst) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2875](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2875) - protoc-gen-openapiv2: RPC visibility setting transitively applied to messages by [@​erademacher](https://togithub.com/erademacher) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2880](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2880) - protoc-gen-openapiv2: Use json_name when generating required field names by [@​patrick246](https://togithub.com/patrick246) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2885](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2885) - fix: support service tags in OpenAPI config file ([#​2817](https://togithub.com/grpc-ecosystem/grpc-gateway/issues/2817)) by [@​y-takuya](https://togithub.com/y-takuya) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2858](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2858) - feat: add option to disable rendering of service tags by [@​kkolur](https://togithub.com/kkolur) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2928](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2928) - fix: required properties of message type are required in OpenAPI by [@​gostajonasson](https://togithub.com/gostajonasson) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2904](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2904) - feat: add option to add description to tags by [@​same-id](https://togithub.com/same-id) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2939](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2939) - add extensions for Tag object by [@​kkolur](https://togithub.com/kkolur) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2950](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2950) - Make registry load packages deterministically by [@​gonzaloserrano](https://togithub.com/gonzaloserrano) in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2945](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2945) #### New Contributors - [@​erademacher](https://togithub.com/erademacher) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2880](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2880) - [@​patrick246](https://togithub.com/patrick246) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2885](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2885) - [@​y-takuya](https://togithub.com/y-takuya) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2858](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2858) - [@​kkolur](https://togithub.com/kkolur) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2928](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2928) - [@​gostajonasson](https://togithub.com/gostajonasson) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2904](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2904) - [@​same-id](https://togithub.com/same-id) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2939](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2939) - [@​gonzaloserrano](https://togithub.com/gonzaloserrano) made their first contribution in [https://github.com/grpc-ecosystem/grpc-gateway/pull/2945](https://togithub.com/grpc-ecosystem/grpc-gateway/pull/2945) **Full Changelog**: grpc-ecosystem/grpc-gateway@v2.11.3...v2.12.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 6am on monday" in timezone Australia/Sydney, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/google/osv.dev). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yNDEuOSIsInVwZGF0ZWRJblZlciI6IjM0LjEyLjAifQ==--> Co-authored-by: Rex P <[email protected]>
Properties of message type having the annotation
[(google.api.field_behavior) = REQUIRED]
are not marked as required in the generated OpenAPI specification.This PR fixes that.
A maintainer should sanity check this PR since it naively removes logic someone added on purpose linking to a "JSON Reference syntax".
Fixes #2837