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

feat(protoc-gen-openapiv2/template): updateSwaggerObjectFromFieldBeha… #5278

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Ccheers
Copy link

@Ccheers Ccheers commented Feb 26, 2025

…vior add default required rule

References to other Issues or PRs

Have you read the Contributing Guidelines?

Brief description of what is fixed or changed

Other comments

@johanbrandhorst
Copy link
Collaborator

Hi, thanks for your PR. Is there an issue this relates to? What is this fixing? Looks to be something related to field behavior?

@Ccheers
Copy link
Author

Ccheers commented Feb 26, 2025

Hi, thanks for your PR. Is there an issue this relates to? What is this fixing? Looks to be something related to field behavior?

In proto3, all fields are Required by default, and the generated pb files are also Required, so the field behavior should be Required by default.

@johanbrandhorst
Copy link
Collaborator

Hm, I suppose that might make sense. Looks like there are quite a few test errors, could you try and fix those please? Also you'll need to regenerate the files, see CONTRIBUTING.md.

@Ccheers
Copy link
Author

Ccheers commented Feb 27, 2025

Hm, I suppose that might make sense. Looks like there are quite a few test errors, could you try and fix those please? Also you'll need to regenerate the files, see CONTRIBUTING.md.

ok

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.

I'm sort of worried that this is going to be a breaking change for users. It may be a semantically correct translation from the proto3 definitions, but this is going to change a LOT of people's swagger definitions. What do you think about adding an option for this? use_proto3_field_semantics perhaps?

@Ccheers
Copy link
Author

Ccheers commented Mar 4, 2025

I'm sort of worried that this is going to be a breaking change for users. It may be a semantically correct translation from the proto3 definitions, but this is going to change a LOT of people's swagger definitions. What do you think about adding an option for this? use_proto3_field_semantics perhaps?

Good Idea 👍

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