I 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
Same for reference type route parameters
Use [BindRequired] and not [Required]
Where should we document this?
Thanks RicoSuter for your help.
I think a good place to document this will be https://github.com/RicoSuter/NSwag/wiki/WebApiOpenApiDocumentGenerator
The web api gen is deprecated and replaced by
https://github.com/RicoSuter/NSwag/wiki/AspNetCoreOpenApiDocumentGenerator
RicoSuter ,
Ok. Thanks. I think the link you provided is a good place to document this.
Thanks
Updated wiki - please also improve the wiki if you have time and it makes sense, etc.
Most helpful comment
Use [BindRequired] and not [Required]