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

Recursive references are not supported #556

Closed
2 tasks done
eggyal opened this issue Apr 22, 2017 · 4 comments
Closed
2 tasks done

Recursive references are not supported #556

eggyal opened this issue Apr 22, 2017 · 4 comments

Comments

@eggyal
Copy link
Contributor

eggyal commented Apr 22, 2017

Prerequisites

  • I have read the documentation;
  • In the case of a bug report, I understand that providing a SSCCE example is tremendously useful to the maintainers.

Description

Recursive references are not supported.

Steps to Reproduce

  1. Define a schema that utilises recursive referencing:

    {
      "definitions": {
        "bar": { "$ref": "#/definitions/qux" },
        "qux": { "type": "string" }
      },
      "type": "object",
      "properties": {
        "foo": {
          "$ref": "#/definitions/bar"
        }
      }
    }

    or

    {
      "definitions": {
        "testdef": { "$ref": "#/definitions/bar" },
        "bar": {
          "type": "object",
          "properties": {
            "qux": { "type": "string" }
          }
        }
      },
      "type": "object",
      "properties": {
        "foo": { "$ref": "#/definitions/testdef/properties/qux" }
      }
    }
  2. Attempt to create a form using those schema.

Expected behavior

Form to be rendered.

Actual behavior

In the first case above (shared playground link), a form is rendered—but where the field is expected, the following message appears:

Unsupported field schema { "$ref": "#/definitions/qux" }

In the second case above (shared playground link), no form is rendered. Console shows:

Error: Could not find a definition for #/definitions/testdef/properties/qux.

Version

0.46.0

@eggyal eggyal mentioned this issue Apr 22, 2017
4 tasks
@micahscopes
Copy link

I think this is a big deal. Any progress?

@yaegerbomb
Copy link

Just ran into this issue. Seems there is a pull request out there but it has UI changes that aren't wanted. Perhaps we can get the bug fix in without those?

@epicfaace
Copy link
Member

It looks like the first case you showed is working now on the playground, but not the second case.

epicfaace added a commit to epicfaace/react-jsonschema-form that referenced this issue Jan 21, 2019
epicfaace added a commit that referenced this issue Jan 21, 2019
* #556 - handle recursive references to deep schema definitions

* test: add tests for recursive references

* fix: handle multiple recursive references to deep schema definitions
@bmfs
Copy link

bmfs commented Apr 23, 2021

Has there been regression on this issue?
The above example crashes in the demo page

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants