Forum Discussion

CasualClicks's avatar
CasualClicks
Occasional Visitor
11 days ago

NEED HELP WITH A PROJECT | Media type as urlencoded | Optional field

Hello, I need support for a project that i am working on.

So, I am generating a swagger doc for RestAPIs and running those in a spring-boot project.

Now, with one of the api, media type is application/x-www-form-urlencoded and for the schema, there are couple of optional fields (the service that would be calling my service may pass those fields, or may not). When making a schema, i declare all the required fields and exclude those that are optional, and it reflects in the documentation.

But, In Spring-Boot, when I build my swagger code, I optional fields in generated interface is set to required=true.

Please help me with this.

No RepliesBe the first to reply