Swashbuckle.AspNetCore icon indicating copy to clipboard operation
Swashbuckle.AspNetCore copied to clipboard

[Question]: I have an optional Parameter in my API request with default value. When I do that, in swagger, I dont see required: true for that field.

Open c6-dark opened this issue 2 months ago • 4 comments

What are you wanting to achieve?

paths: get: summary: Example endpoint parameters: - name: optionalParam in: query required: false schema: type: string responses: '200': description: Successful response

I am not getting required: false for the optional parameter. Is there a way to explicitly show required: false for optional parameters?

What code or approach do you have so far?

paths: get: summary: Example endpoint parameters: - name: optionalParam in: query required: false schema: type: string responses: '200': description: Successful response

Additional context

No response

c6-dark avatar Dec 10 '24 17:12 c6-dark