cloudflare / cloudflare/json-schema-tools

json-schema-ref-loader can't handle circular references

Open
#2 5 comments 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
341
Forks
32
PR merge metrics
No merged PRs in 30d

Description

A simple JSON schema:
```JS
{
"$schema": "http://json-schema.org/draft-04/schema#",

"definitions": {
"node": {
"title": "a node",
"type": "object",
"properties": {
"children": {
"type": "array",
"items": {
"$ref": "#/definitions/node"
}
}
}
}
}
}
```

causes json-schema-loader to fail with the following error:
```
ERROR in ../src/schema/node.json
Module build failed: TypeError: Converting circular structure to JSON
at JSON.stringify ()
at Object.handleResolveSuccess (/Users/fabian/projects/node-lib-spec/schema-doc/node_modules/json-schema-loader/lib/loader.js:19:21)
at
```

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.