Skip to content
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-openapiv2 generating the wrong schema fixing the issue #2635 #2769

Closed
wants to merge 25 commits into from
Closed

Conversation

lakshkeswani
Copy link
Contributor

@lakshkeswani lakshkeswani commented Jun 27, 2022

References to other Issues or PRs

This PR Fixes the issue #2635

Have you read the Contributing Guidelines?

YES

Brief description of what is fixed or changed

Removed the duplication of required elements in the object schema by comparing it with the field schema only adding the unique ones .
Set the required array nil of field schema form swagger properties this is not required.
what is changed in the code?
Added the getUniqueFields method that will return the schema of unique fields.
simply append the unique one to the field schema.

Other comments

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the build error as well please

protoc-gen-openapiv2/internal/genopenapi/template.go Outdated Show resolved Hide resolved
protoc-gen-openapiv2/internal/genopenapi/helpers.go Outdated Show resolved Hide resolved
protoc-gen-openapiv2/internal/genopenapi/helpers.go Outdated Show resolved Hide resolved
@lakshkeswani
Copy link
Contributor Author

Fix the build error as well please

where can I see the build error? its now showing up for me

Copy link
Collaborator

@johanbrandhorst johanbrandhorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, just a few whitespace fixes left!

@johanbrandhorst
Copy link
Collaborator

johanbrandhorst commented Aug 15, 2022

Looks like you need to pull master and regenerate.

@johanbrandhorst
Copy link
Collaborator

Hi @lakshkeswani, I want to make a new release soon, would you have time to rebase this change on master and regenerate the files?

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants