-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ignore specific markers in openapi generation from protos #576
Conversation
Issues linked to changelog: |
baseArgument := "--openapi_out=yaml=true,single_file=false,include_description=true,multiline_description=true,proto_oneof=true,int_native=true" | ||
baseArgument = fmt.Sprintf("%s,enum_as_int_or_string=%v", baseArgument, o.EnumAsIntOrString) | ||
baseArgument = fmt.Sprintf("%s,additional_empty_schema=%v", baseArgument, strings.Join(o.MessagesWithEmptySchema, "+")) | ||
baseArgument = fmt.Sprintf("%s,disable_kube_markers=%v", baseArgument, o.DisableKubeMarkers) | ||
baseArgument = fmt.Sprintf("%s,ignored_kube_marker_substrings=%v", baseArgument, strings.Join(o.IgnoredKubeMarkerSubstrings, "+")) |
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.
If you want to make this more readable, I'd group these options into a slice and use strings.Join()
.
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.
Yeah honestly I should have done that. I think this is better than what we have, so if we revisit this and add another argument we could improve this again.
Description
This allows for the user to define a list of kube markers to be ignored. Useful when referencing a .proto dependency which contains kube markers that aren't supported, and will never be supported.
Use case: I'm defining a proto that relies on some upstream dependency that also contains their own kube markers. These kube markers exist only for documentation, and do not affect the open api schema. Rather than implement noop markers to add to a marker registry, I would like to simply ignore them.
This adds:
This changes:
Related Issue: solo-io/protoc-gen-openapi#27
Testing Done
See parent PR