Forum Discussion

simecek's avatar
simecek
New Contributor
2 years ago
Solved

SwaggerHub mock server with externalValue example

Hello,

I'm getting 406 Not Acceptable responses when I'm trying to use externalValue property in example object on swaggerhub mocked server. I dont know if I'm doing something wrong or this feature is not implemented on swaggerhub mocking server? Thanks for any answers.

 

paths:
  /test:
    get:
      responses:
        "200":
          description: OK!
          content:
            application/json:
              schema:
                type: string
                format: binary
              examples:
                example:
                  externalValue: "https://jsonplaceholder.typicode.com/todos/1"
            application/pdf:
              schema:
                type: string
                format: binary
              examples:
                sampleFile:
                  externalValue: "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"

 

 

My API

https://app.swaggerhub.com/apis/simecek/test/1.0.0

 

Mocked server

https://virtserver.swaggerhub.com/simecek/test/1.0.0/test

 

External value example documentation

https://swagger.io/docs/specification/adding-examples/

 

 

2 Replies

  • chichepo's avatar
    chichepo
    Champion Level 2

    Hi simecek
    I am not sure if it is helpful to set a content definition to a GET since it does not content anything.

    Anyway, did you try to set the Accept header to */*?