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

New problem with 'entries' in property name #6033

Closed
aloysiustany opened this issue May 25, 2020 · 2 comments · Fixed by #6036
Closed

New problem with 'entries' in property name #6033

aloysiustany opened this issue May 25, 2020 · 2 comments · Fixed by #6036
Assignees
Milestone

Comments

@aloysiustany
Copy link

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Version: 81
  • Method of installation: editor.swagger.com
  • Swagger-UI version: I think editor.swagger.com is using the latest i.e. 3.25.4
  • Swagger/OpenAPI version: Swagger 2.0

Content & configuration

This looks like another new problem when having 'entries' as property name. Other properties in the same level of 'entries' properties, fails to load with error "Could not render this component, see the console"

Example Swagger/OpenAPI definition:

  swagger: '2.0'
  info:
    title: Test Me
    version: '1'
  paths:
    '/test/me':
      get:
        summary: Test api
        operationId: getTestMe
        produces:
          - '*/*'
        responses:
          '200':
            description: OK
            schema:
              $ref: '#/definitions/TestMeDto'
          '500':
            description: Internal Server Error
        deprecated: false
  definitions:
    TestMeDto:
      type: object
      properties:
        name: 
          type: string
        age: 
          type: string
        entries: 
          type: array
          items:
            $ref: '#/definitions/TestMeEntries'
    TestMeEntries:
      type: object
      properties:
        date: 
          type: string
        time: 
          type: string

Describe the bug you're encountering

To reproduce...

Try to load swagger ui and use yaml above

Screenshots

image

if I change entries to entries-new, it works as expected:
image

@shindigira
Copy link

shindigira commented May 26, 2020

I am confirming this issue where any property named entries causes an error. In my case where I am utilizing hapi-swagger which in turn relies on swagger-ui, I get the error below.

Screen Shot 2020-05-26 at 4 17 58 PM

Note: I am not missing a valid version field despite the presented error message. This goes away when I rename "entries" to any other field name.

tim-lai added a commit to tim-lai/swagger-ui that referenced this issue May 26, 2020
tim-lai added a commit to tim-lai/swagger-ui that referenced this issue May 27, 2020
Ref: swagger-api#6033

* 'createObjWithHashedKeys' validation consistency with isFunction
* 'createObjWithHashedKeys' additional jsdoc example
tim-lai added a commit to tim-lai/swagger-ui that referenced this issue May 27, 2020
Ref: swagger-api#6033

* 'createObjWithHashedKeys' validation consistency with isFunction
* 'createObjWithHashedKeys' additional jsdoc example
@tim-lai
Copy link
Contributor

tim-lai commented May 27, 2020

@aloysiustany @shindigira this will be fixed in the next release, via bec6aeb

tim-lai added a commit to tim-lai/swagger-ui that referenced this issue May 28, 2020
Ref: swagger-api#6033

* 'createObjWithHashedKeys' validation consistency with isFunction
* 'createObjWithHashedKeys' additional jsdoc example
tim-lai added a commit that referenced this issue May 28, 2020
Ref: #6033

* 'createObjWithHashedKeys' validation consistency with isFunction
* 'createObjWithHashedKeys' additional jsdoc example
@frantuma frantuma added this to the M2 milestone Jun 2, 2020
mattyb678 pushed a commit to mattyb678/swagger-ui that referenced this issue Jun 24, 2020
Ref: swagger-api#6033

* 'createObjWithHashedKeys' validation consistency with isFunction
* 'createObjWithHashedKeys' additional jsdoc example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants