cbet
7 years agoNew Member
Does response type must match `type` parameter of property in swagger.json?
Let's assume we have specified an object like this:
"Topic" : {
"type" : "object",
"required" : [ "id" ],
"properties" : {
"id" : {
"type" : "string"
},
"title" : {
"type" : "string"
},
"text" : {
"type" : "string"
},
"timestamp" : {
"type" : "integer",
"format" : "int64"
}
}
}
with server response like this:
{
"id": "348750893475",
"title": "Title",
"text": "Info text",
"timestamp": "15628369075436"
}
Is it swagger contract violation that `timestamp` resonse type is `string`?
Should client try by himself recognize that `timestamp` is string and convert such string to number?
Is following `type` property of swagger.json in server resonse is required and a must?