swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.56k stars 8.95k forks source link

Self-reference: RangeError: Maximum call stack size exceeded #5192

Open jzakrzewski opened 5 years ago

jzakrzewski commented 5 years ago

Q&A (please complete the following information)

Content & configuration

Example Swagger/OpenAPI definition:

basePath: /control
consumes:
- application/json
definitions:
  ObjectQueryWithKeys:
    properties:
      condition:
        $ref: '#/definitions/ObjectQueryCondition'
  ObjectQueryCondition:
    properties:
      conditionsType:
        type: string
      conditions:
        items:
          $ref: '#/definitions/ObjectQueryCondition'
        type: array
info:
  description: Yeah, whatever.
  title: Controller
  version: '1.0'
paths:
  /pstate/classes/PurchaseOrder/objects/query:
    post:
      parameters:
      - description: Structured object query
        in: body
        name: query
        required: true
        schema:
          $ref: '#/definitions/ObjectQueryWithKeys'
      responses:
        '204':
          description: No content
produces:
- application/json
swagger: '2.0'

Describe the bug you're encountering

Cannot expand the operation. The following is logged on the Chrome Dev Console:

RangeError: Maximum call stack size exceeded
    at Ue.get (immutable.js:1245)
    at jt (immutable.js:2753)
    at Pt.set (immutable.js:2686)
    at immutable.js:2651
    at te.__iterate (immutable.js:418)
    at te.forEach (immutable.js:4381)
    at immutable.js:2651
    at Pt.Ue.withMutations (immutable.js:1353)
    at Object.Pt [as OrderedMap] (immutable.js:2648)
    at e (utils.js:64)

To reproduce...

Steps to reproduce the behavior:

  1. Try to expand /pstate/classes/PurchaseOrder/objects/query

Expected behavior

The operation expands, allowing me to view and try it.

jzakrzewski commented 5 years ago

BTW: Expanding the model definition crashes in exactly the same way.