swagger-api / swagger-api/swagger-ui
Self-reference: RangeError: Maximum call stack size exceeded
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 29k
- Forks
- 9.3k
- Avg merge
- 2d 23h
- Merged PRs (30d)
- 25
Description
Q&A (please complete the following information)
- OS: Ubuntu 16.04
- Browser: Chrome / Firefox
- Version: 72.0.3626.71 / Quantum (up-to-date)
- Method of installation: dist assets
- Swagger-UI version: tested 3.18.2 and 3.20.9
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:
- Try to expand /pstate/classes/PurchaseOrder/objects/query
Expected behavior
The operation expands, allowing me to view and try it.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by loading the supplied Swagger 2.0 definition in Swagger UI and expanding the POST operation for /pstate/classes/PurchaseOrder/objects/query. Follow the reported stack through immutable.js and utils.js to identify where the recursive ObjectQueryCondition schema causes the overflow. Done means the operation expands without a RangeError while preserving the nested schema structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100