Ask a Question
Back to All

Getting error "type must be array" while uploading Swagger file


While uploading the Swagger ".json" file on readme.io, I'm facing the below error:

Relevant JSON block from the Swagger file:

"getProductInventorySnapshot": {
  "type": "object",
  "properties": {
    "sku": {
      "required": true,
      "type": "string",
      "example": "TEST-750"
    "upc": {
      "type": "integer",
      "example": "816136021655"

Based on the requirements, that parameter has to be the "string" type but the error is saying to change it to an array. I'm not sure why.

Also, there are already other end-point having params with with "string" type and there is no issue with that.

Any help would be appreciated.