Ask a Question

Swagger: Submitting integer in multipart/form-data?

theminja
Visitor

Swagger: Submitting integer in multipart/form-data?

I am trying to submit an integer within the form but I get the error: "message": "request/body/price must be integer",

 

Here is the request:

 

 

  /item:
    post:
      security:
        - bearerAuth: []
      description: Upload Item
      requestBody:
        description: Request Body
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Item'
      responses:
        201:
          description: Item Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ItemUploadSuccess'
        default:
          description: Unexpected Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

 

 

And here is the Item schema it's referring to:

 

 

    Item:
      type: object
      properties:
        fileImage:
          type: string
          format: binary
        name:
          type: string
        price:
          type: integer
        condition:
          type: string
          enum: [like new, great, good, poor]
      required:
        - name
        - price
        - condition

 

 

Can I not submit an integer within multipart/form data? Any advice is appreciated

0 REPLIES 0
cancel
Showing results for 
Search instead for 
Did you mean: