Required string query parameters are displayed as Nullable
See original GitHub issueI am using latest version of Nswag (V13.xx) along with OpenApiDocument.
The string query parameters are displayed as Nullable on Swagger document when using both [Required] [FromQuery] attributes or only the [Required] attribute. Below is the code sample:
public ActionResult<List<Dictionary<string, string>>> Get([Required] [FromQuery] string format) { .... }
Is there another way to make Nswag to no display the string query parameter as Nullable?
Thanks
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Nullable Types in query string always show as required #555
We are using nullable query string parameters on our controller methods. When using the command line generator, these parameters always show ...
Read more >c# - Query parameter always required
Query parameter always required · make it optional: string type = null ,. – abdusco · Make the parameter optional: ([FromRoute] int imageId,...
Read more >How to set default query string parameter value for webapi?
May I know how to set a default query string value for webapi in . NET 6? "errors":{"name":["The name field is required."]}
Read more >Using Optional and Nullable Properties in API Requests
Learn how optional and nullable properties can be used flexibly in combinations in each parameter of your API requests made from a SDK....
Read more >Handling query string parameters with no value in ASP.NET ...
Handling query string parameters with no value in ASP.NET Core - Thomas Levesque's . NET Blog.
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
Use [BindRequired] and not [Required]
Updated wiki - please also improve the wiki if you have time and it makes sense, etc.