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

Support extensions for tags #2942

Closed
kkolur opened this issue Oct 13, 2022 · 4 comments
Closed

Support extensions for tags #2942

kkolur opened this issue Oct 13, 2022 · 4 comments

Comments

@kkolur
Copy link
Contributor

kkolur commented Oct 13, 2022

🚀 Feature

Tags have been implemented at the root level as a result of this PR. According to OpenAPI extensions should be available to the Tag object as well.

For example, ReDoc has some vendor extensions available for Tag Objects. You can see here how its used and how its rendered

@johanbrandhorst
Copy link
Collaborator

Thanks for the feature request! I think we need to take a holistic view at extensions, the page you linked details all the places where extensions can exist in the OpenAPIv2 spec. It would make sense to me to add a message to describe the extension type and then add that to all the places extensions can be specified. What do you think?

@kkolur
Copy link
Contributor Author

kkolur commented Oct 14, 2022

Thanks for the feature request! I think we need to take a holistic view at extensions, the page you linked details all the places where extensions can exist in the OpenAPIv2 spec. It would make sense to me to add a message to describe the extension type and then add that to all the places extensions can be specified. What do you think?

@johanbrandhorst sorry im having trouble understanding the following, can you provide an example?

It would make sense to me to add a message to describe the extension type and then add that to all the places extensions can be specified

Do you mean we should create seperate Messages for every place extensions can be added to? Like SwaggerExtensions, OperationExtensions, InfoExtensions, TagExtensions, etc?

For most places already in protoc-gen-openapiv2, extensions are added to the messages (Swagger, Operation, Info, etc) like so: Example here

I was thinking we just follow the same pattern by adding the following line of code to the Tag Message:

map<string, google.protobuf.Value> extensions = 3;

And then do the necessary Go changes

Thoughts?

@johanbrandhorst
Copy link
Collaborator

You're right, I didn't think we already had extensions in some places, so lets just go ahead and continue that pattern.

@johanbrandhorst
Copy link
Collaborator

Fixed in #2950

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants