swagger-api / validator-badge

Validate your Swagger JSON/YAML today!
http://swagger.io
Apache License 2.0
210 stars 85 forks source link

Swagger/OpenAPI - UnrecognizedPropertyException #113

Open suryakumar101987 opened 7 years ago

suryakumar101987 commented 7 years ago

Getting below error when using the given request model

"Error 500: javax.servlet.ServletException: org.codehaus.jackson.map.exc.UnrecognizedPropertyException: Unrecognized field "RQSHDR" (Class iseries.wsbeans.ServiceInput.RQSHDR_DS), not marked as ignorable

Request:

"{\"RQSHDR\":[{\"ID\":\"20423\",\"Name\":\"226229\",\"DOCTYPE\":\"EXCEL\"}],\"RQSLEN\":1,\"RQSDS\":[{\"DSID\":\"148490\",\"DS\":\"40026\",\"AMOUNT\":\"250.00\"}]}"

Here is sample code:

"ServiceInput": { "type": "object", "properties": { "RQSHDR": { "type": "object", "$ref": "#/definitions/rqshdr_DS" }, "RQSLEN": { "type": "integer", "format": "int32" }, "RQSDS": { "type": "array", "items": { "$ref": "#/definitions/rqsdtl_DS" } } } }

And
"rqshdr_DS": { "type": "object", "properties": { "ID": { "type": "string", "maxLength": 30 }, "NAME": { "type": "string", "maxLength": 10 }, "DOCTYPE": { "type": "string", "maxLength": 4 } } }, "rqsdtl_DS": { "type": "object", "properties": { "DSID": { "type": "string", "maxLength": 10 }, "DS": { "type": "string", "maxLength": 25 }, "AMOUNT": { "type": "string", "maxLength": 12 } } },

Please assist to resolve

kamaruddin-desai commented 6 years ago

Facing the same issue. Please update.