adobe / adobe/jsonschema2md

Maximum call stack size exceeded

Open
#221 11 comments 3 reactions 1 assignee Claimed by @trieloff View on GitHub
bug
Dominant language
JavaScript
Stars
724
Forks
150
Avg merge
18h 22m
Merged PRs (30d)
4

Description

## What did you do

- Update jsonschema2md to v4.1.1
- ran conversion for single schema file

## What did you expect to happen

Conversion to mark down without errors

## What happened

Since v4.0.4 it fails with an exception:

(Figured out, that it is not guaranteed to fail, sometimes it just works; I know, those are the worst bugs ever)

converter failed with exception

```
[build] (node:19698) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
[build] at Array.join (native)
[build] at keyword (/usr/lib/node_modules/@adobe/jsonschema2md/lib/keywords.js:16:14)
[build] at Object.meta.(anonymous function) (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:42:28)
[build] at Object.get (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:104:26)
[build] at Object.meta.(anonymous function) (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:46:20)
[build] at Object.get (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:104:26)
[build] at Object.meta.(anonymous function) (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:46:20)
[build] at Object.get (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:104:26)
[build] at Object.meta.(anonymous function) (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:46:20)
[build] at Object.get (/usr/lib/node_modules/@adobe/jsonschema2md/lib/schemaProxy.js:104:26)
```

```
[build] [100%] Converting json schema files to markdown
[build] loading schemas
```

## What's your environment

* Operating System: Ubuntu 18.04
* node.js version: v10.20.1

## Do you have example files:

For this schema
```json
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://tqswip.com/common/controlling/controller",
"title": "Controller Configuration",
"type": "object",
"properties": {
"ProcessData": {
"title": "Named data variables used in jobs",
"type": "array",
"items": {
"type": "string"
}
},
"RtpcMapping": {
"title": "Mapping between ProcessData and Rtpc Parameter",
"description": "Parameter are requested on Rtpc and will be assigned to the process data as configured.",
"type": "object",
"propertyNames": {
"enum": [
"Gewicht_Netto",
"Gewicht_Avr",
"Volumen"
]
},
"patternProperties": {
"": {
"type": "string"
}
}
},
"Segments": {
"title": "Processing Segment Definitions",
"type": "array",
"items": {
"$ref": "#/definitions/segment"
}
}
},
"required": [
"Segments",
"ProcessData",
"RtpcMapping"
],
"examples": [
{
"ProcessData": [
"huhu"
],
"RtpcMapping": {
"Gewicht_Netto": "huhu"
},
"Segments": [
{
"id": 12,
"Name": "huhu",
"Sequence": [
{
"Type": "jolo",
"huu": 12
},
{
"Type": "jolo",
"Inputs": {
"Grading": "huhu"
}
},
{
"Sequence": [
{
"Type": "123",
"maxV": 23
}
]
}
]
}
]
}
],
"definitions": {
"segmentSchema": {
"type": "object",
"properties": {
"id": {
"type": "number"
},
"Name": {
"type": "string"
}
},
"required": [
"id"
]
},
"segmentNames": {
"enum": [
"id",
"Name"
]
},
"jobSchema": {
"type": "object",
"properties": {
"Type": {
"type": "string"
},
"Inputs": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
},
"Outputs": {
"type": "object",
"patternProperties": {
"": {
"type": "string"
}
}
}
},
"required": [
"Type"
],
"not": {
"anyOf": [
{
"required": [
"Sequence"
]
},
{
"required": [
"Parallel"
]
}
]
}
},
"jobNames": true,
"combinedJobSchema": {
"type": "object",
"oneOf": [
{
"properties": {
"Sequence": {
"type": "array",
"items": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/anyJobSchema"
},
{
"if": {
"required": [
"Type"
]
},
"then": {
"propertyNames": {
"$ref": "#/definitions/jobNames"
}
},
"else": {
"propertyNames": {
"$ref": "#/definitions/combinedJobNames"
}
}
}
]
}
}
},
"anyOf": [
{
"required": [
"Sequence"
]
},
{
"required": [
"Parallel"
]
}
]
}
],
"not": {
"required": [
"Type"
]
}
},
"combinedJobNames": {
"enum": [
"Sequence",
"Parallel"
]
},
"anyJobSchema": {
"if": {
"required": [
"Type"
]
},
"then": {
"$ref": "#/definitions/jobSchema"
},
"else": {
"$ref": "#/definitions/combinedJobSchema"
}
},
"segment": {
"type": "object",
"allOf": [
{
"$ref": "#/definitions/segmentSchema"
},
{
"$ref": "#/definitions/anyJobSchema"
},
{
"if": {
"required": [
"Type"
]
},
"then": {
"propertyNames": {
"anyOf": [
{
"$ref": "#/definitions/segmentNames"
},
{
"$ref": "#/definitions/jobNames"
}
]
}
},
"else": {
"propertyNames": {
"anyOf": [
{
"$ref": "#/definitions/segmentNames"
},
{
"$ref": "#/definitions/combinedJobNames"
}
]
}
}
}
]
}
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.