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

[Feature Request]x- series extensions support #23

Closed
ipfans opened this issue Jun 3, 2021 · 2 comments
Closed

[Feature Request]x- series extensions support #23

ipfans opened this issue Jun 3, 2021 · 2 comments

Comments

@ipfans
Copy link

ipfans commented Jun 3, 2021

E.g. x-codeSamples is a extension for OpenAPI, it is not standard.

There are some extension tags that very useful for generate docs from code. So it should be a new feature or just I missed something that can do this?

@vearutop
Copy link
Member

vearutop commented Jul 5, 2021

Hi @ipfans, sorry for late reply.

Extensions can be added with Operation.WithMapOfAnything for a full map of extensions, or Operation.WithMapOfAnythingItem for a single item, or assigning directly to MapOfAnything property.

Please note that functions With* are mutating original receiver.

op.WithMapOfAnythingItem("x-codeSamples", CodeSample{Lang:"Go", Source:"a:=1"})

All the types that support x- extensions have these symbols available.

@ipfans
Copy link
Author

ipfans commented Jul 6, 2021

@vearutop Thanks, I got it.

@ipfans ipfans closed this as completed Jul 6, 2021
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

No branches or pull requests

2 participants