I am using Spring Boot and Open API 3. Through OAS2 Swagger when I make a POST request, I see that all String fields are coming default value as a Spring and I don't see a way to remove it, either through SpringDoc Open UI nor through code.
{
"firstName": "string",
"lastName": "string",
"age": 0,
"email": "string",
"address1": "string",
"address2": "string",
"address3": "string",
"telephone" : "0",
"department" : "string",
.....
}
Here consumer not willing to remove the string from field while making the request. Is there any way
You could use
@Schema(example = "<your example here>")
to provide another example for swagger-ui.
For ""
you can do (yes, it's a space):
@Schema(example = " ")