How to valid input data type on swagger-ui
Hi all, My model schema: { "wareHouseID": 0, "parentID": 0, "name": "string", "fullname": "string", "company": "string", "address": "string" }
Now i want to catch error if input wareHouseID and parentID are "String".
Tell me what should i do? Thanks
That's out of scope for swagger-core, the project does Swagger specification generation, not validation.
Thanks @webron.
{
"id": String,
"category": {
"id": 0,
"name": "string"
},
"name": "doggie",
"photoUrls": [
"string"
],
"tags": [
{
"id": 0,
"name": "string"
}
],
"status": "available"
}
When input id is String
pet store swagger result:
{
"code": 400,
"type": "unknown",
"message": "bad input"
}
How can i catch same this.
That's just regular code, again, not specific to swagger-core. You can check the source code for the pet store here - https://github.com/swagger-api/swagger-samples/tree/master/java/java-jersey-jaxrs.
Hi, the JSON above is actually not valid--"id":String is missing quotes. Please reopen an issue in swagger-ui if you think there's a problem still.