Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field name "entries" in a schema causes swagger-editor to fail #2155

Closed
jmmolina796 opened this issue May 18, 2020 · 1 comment
Closed

Field name "entries" in a schema causes swagger-editor to fail #2155

jmmolina796 opened this issue May 18, 2020 · 1 comment

Comments

@jmmolina796
Copy link

jmmolina796 commented May 18, 2020

When I type the field name entries, I received a message saying: "Unable to render this definition".

paths:
  /pet:
    post:
      summary: "Add a new pet to the store"
      description: ""
      parameters:
      - in: "body"
        name: "body"
        schema:
          $ref: "#/definitions/Pet"
      responses:
        "405":
          description: "Invalid input"
definitions:
  Pet:
    type: "object"
    properties:
      id:
        type: "integer"
      entries:
        type: "array"
        items:
          type: "string"

Screen Shot 2020-05-18 at 17 14 21

I need to write entries as a field since my API requires this name.

If I change entries to entry, it works as expected.

paths:
  /pet:
    post:
      summary: "Add a new pet to the store"
      description: ""
      parameters:
      - in: "body"
        name: "body"
        schema:
          $ref: "#/definitions/Pet"
      responses:
        "405":
          description: "Invalid input"
definitions:
  Pet:
    type: "object"
    properties:
      id:
        type: "integer"
      entry:
        type: "array"
        items:
          type: "string"

Can someone help me with this problem, why it fails when I use entries as a field name?

@hkosova
Copy link
Contributor

hkosova commented May 19, 2020

Thanks for the report! This issue is tracked in swagger-api/swagger-ui#6016 so I'll close this one as a duplicate.

As a workaround please use editor v. 3.8.2, you can download it from the Releases page.

@hkosova hkosova closed this as completed May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants