Skip to content

Resolver crashes when encountering a $ref at root level #2471

@sdirix

Description

@sdirix

Describe the bug

When a JSON Schema specifies a $ref at the root level of the schema, our resolver often ends up in an endless recursion until a maximum stack error is thrown.

Example JSON Schema:

{
 "definitions": {
   "foo": {
     "type": "string"
   }
 },
 "$ref": "#/definitions/foo"
}

The issue is caused by this check.

Expected behavior

The resolver should not end up in an endless recursive "loop" when the actual schema is loop-free.

Steps to reproduce the issue

  1. Use JSON Forms to render the schema above
  2. Observe console logs

Screenshots

No response

Which Version of JSON Forms are you using?

3.6.0

Package

Core

Additional context

Related discussion: https://jsonforms.discourse.group/t/recursive-schema-error/2746

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions