We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
What is the proper way to set the header name in a param or response definition? Example:
type FooResponse struct { // X-Foo header // // in: header // name: X-Foo XFoo string // ... }
This creates a "valid" swagger definition, as:
"headers": { "XFoo": { "type": "string", "description": "X-Foo header\n\nin: header\nname: X-Foo" },
Is this the best I can do? Or is there some way to instead get:
"headers": { "X-Foo": { "type": "string", "description": "X-Foo header" },
?
The text was updated successfully, but these errors were encountered:
I believe you can use a json:"X-Foo" tag to allow for overriding the name
json:"X-Foo"
Sorry, something went wrong.
Brilliant! That does indeed do the trick. Thanks!
For anyone that got here via a google search the answer is
type FooResponse struct { // X-Foo header XFoo string json:"X-Foo" // ... }
or at least that is what worked for me.
No branches or pull requests
Problem statement
What is the proper way to set the header name in a param or response definition? Example:
This creates a "valid" swagger definition, as:
Is this the best I can do? Or is there some way to instead get:
?
The text was updated successfully, but these errors were encountered: