How to define path and formData parameters for the same operation in OpenAPI 2.0?

前端 未结 1 1406
Happy的楠姐
Happy的楠姐 2021-01-17 21:15

I have an image upload endpoint that looks like /test/{id}/relationships/image. I want to describe this endpoint using OpenAPI 2.0 (Swagger 2.0).

The en

1条回答
  •  难免孤独
    2021-01-17 21:42

    In your path parameter, change

              schema:
                type: integer
                format: int32
    

    to

              type: integer
              format: int32
    

    In OpenAPI/Swagger 2.0, path, header, query and formData parameters use type directly, without a schema. The schema keyword is used for body parameters only.

    0 讨论(0)
提交回复
热议问题