Forum Discussion

k1derly's avatar
k1derly
Visitor
4 years ago
Solved

Response object property named "entries" causes editor.swagger.io to error.

editor.swagger.io fails to render if the spec file contains a response with an object property named "entries".

This spec DOES NOT render:

openapi: 3.0.0
  info:
    title: test
    version: 1.0.0
  paths:
    '/test':
      get:
        summary: test
        responses:
          '200':
            description: test
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    entries:
                      type: string

 

The editor shows this error message:

Unable to render this definition

The provided definition does not specify a valid version field.

Please indicate a valid Swagger or OpenAPI version field. Supported version fields are swagger: "2.0" and those that match openapi: 3.0.n (for example, openapi: 3.0.0).

 

This spec DOES render. The only difference is the name of the property was changed from "entries" to "entries1":

openapi: 3.0.0
  info:
    title: test
    version: 1.0.0
  paths:
    '/test':
      get:
        summary: test
        responses:
          '200':
            description: test
            content:
              application/json:
                schema:
                  type: object
                  properties:
                    entries1:
                      type: string

 

 

  • Hi k1derly, thanks for the report. It's a bug in the latest release of Swagger Editor, the issue is tracked here:

    https://github.com/swagger-api/swagger-ui/issues/6016

     

    As a workaround, please use Swagger Editor version 3.8.2, you can download it from the Releases page. To run the editor locally, open the index.html file in your browser, or put index.html and the dist folder on a web server and load it from there.

1 Reply

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)

    Hi k1derly, thanks for the report. It's a bug in the latest release of Swagger Editor, the issue is tracked here:

    https://github.com/swagger-api/swagger-ui/issues/6016

     

    As a workaround, please use Swagger Editor version 3.8.2, you can download it from the Releases page. To run the editor locally, open the index.html file in your browser, or put index.html and the dist folder on a web server and load it from there.