How to customise the name of property?
See original GitHub issueI have a WebApi controller action that takes a string authToken
parameter, which it reads from the Auth-Token
header. swagger-ui code-gens this as authToken
which means requests via swagger-ui don’t write the header correctly.
How can I customise the name of this parameter so that swagger-ui does the right thing?
Issue Analytics
- State:
- Created 9 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to Change the Name on Property Title Deeds in Texas
If the current owner's name has been legally changed, you may want to file a deed showing the name change. A Warranty Deed...
Read more >How to Change the Title of Your Home
It's possible to get a title change on your home's deed, though this is different from changing the name on the mortgage. The...
Read more >How to Change the Name of the Owner on a House Title
You will then need to get the deed notarized. Choose the Right Deed. You must use a deed to do make changes to...
Read more >Reasons to Change the Name on a House Deed and (How ...
Give everyone a heads-up on your name change. · Be prepared to show alternate forms of identification. · To file a quitclaim, you...
Read more >How to Change the Name on a Property Title | Real Estate Law
How to Change the name on a Property Title | Real Estate Law | LegalShield Are you the new owner of real estate...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The exact implementation for this depends on how you’ve implemented the header-to-parameter binding in WebApi. I did it by creating two custom classes - FromHeaderAttribute (derived from ParameterBindingAttribute) and HeaderParameterBinding (derived from HttpParameteBinding). I can share the details if needed but the net result gave me a re-usable attribute (similar to FromUri and FromBody) for binding string parameters to header values. For example …
Then, to describe these parameters correctly in the resulting Swagger, I implemented and wired up a custom IOperationFilter (see readme) that updates the descriptions accordingly:
This worked first go … the swagger description and hence swagger-ui described the parameters correctly and the correct headers get sent when a request is made through the UI.
Try it out and let me know how it goes
Richie
It’s very helpful for Swashbuckle version 4, however, in version 5.0.0-rc4 the interface is changed to
interface IOperationFilter { void Apply(OpenApiOperation operation, OperationFilterContext context)
;and not clearly how to make the parameters