Forum Discussion

LennSar's avatar
LennSar
Contributor
3 years ago

Swagger Compliance Assertion: Invalid content type [image/bmp]

Hi there,

 

I wonder why I get the error mentioned in the topic. The image is properly transfered and displayed. Also I think image/bmp as a content type should be allowed. 
Any suggestion what could go wrong here? 

 

Thanks in advance!

  • Hi KarelHusa,

     

    thanks for the suggestions. I forgot to say it because it became so self-evident for me to have a proper OpenApi.yaml. 
    image/bmp is the defined content-type in the swagger UI so the compliance assertion actually should get it right. Maybe you see something in our definition that I don't see:


    LennSar wrote:

    Hi there,

     

    I wonder why I get the error mentioned in the topic. The image is properly transfered and displayed. Also I think image/bmp as a content type should be allowed. 
    Any suggestion what could go wrong here? 

     

    Thanks in advance!


      /screenshot.bmp:
        get:
          servers:
            - url: http://{Hostname}
              description: http direct
              variables:
                Hostname:
                  default: 169.254.2.0
                  description: Hostname of the device
            - url: https://{Hostname}
              description: https direct
              variables:
                Hostname:
                  default: 169.254.2.0
                  description: Hostname of the device
            - url: http://{Hostname}/{ID}
              description: http forward
              variables:
                Hostname:
                  default: 169.254.2.0
                  description: Hostname of the device
                ID:
                  default: "1"
                  description: System ID of the device
                  enum:
                    - "1"
                    - "2"
                    - "3"
                    - "4"
            - url: https://{Hostname}/{ID}
              description: https forward
              variables:
                Hostname:
                  default: 169.254.2.0
                  description: Hostname of the device
                ID:
                  default: "1"
                  description: System ID of the device
                  enum:
                    - "1"
                    - "2"
                    - "3"
                    - "4"
          summary: Get a screenshot
          operationId: GET_screenshot.bmp
          responses:
            "200":
              description: Screenshot in BMP format
              content:
                image/bmp:
                  schema:
                    type: string
                    format: binary
            "405":
              description: Method not allowed. Rights missing?



    • KarelHusa's avatar
      KarelHusa
      Champion Level 1

      If the API specification permits the content type and the response matches, it seems like a bug in the ReadyAPI assertion evaluation.

  • thanks JoostDG for letting me know. I think I've seen that post before which is why I assumed it is a bug. I was just hoping it's not since the issue seems to be known for quite a while.