Error while using array in Post specification

15 views
Skip to first unread message

Kreative76

unread,
Apr 17, 2018, 1:36:22 PM4/17/18
to Swagger
Within a post API, I have following array specifications

{
          "name": "Phone",
          "in": "formData",
          "description": "List of Phone object",
          "schema": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/postedPhone"
             }
          }
        }
        ],


But this gives an error, this error is misleading for sure but I don't know what the issue is here. I have declared postedPhone definition in the editor as well. If I change above to "items": {
                        "type": "string"
                    } it works... Is there any issue with posting formData as an array in swagger 2.0?

Errors I got

Schema error at paths['/{XXX}/update'].post.parameters[14]

should NOT have additional properties additionalProperty: schema, name, in, description

Schema error at paths['/{XXX}/update'].post.parameters[14].in

should be equal to one of the allowed values allowedValues: body, header, query, path

Ron Ratovsky

unread,
May 1, 2018, 3:27:54 PM5/1/18
to swagger-sw...@googlegroups.com

In Swagger/OAS 2.0 – form data parameters do not allow the use of complex types.

If that’s a requirement for you, you would need to use OAS3.

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
swagger-swaggers...@googlegroups.com.
For more options, visit
https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages