RefParser

Jedison includes a RefParser class, which processes a JSON Schema and builds an internal list of dereferenced $ref pointers.
You can pass the RefParser instance to a Jedison instance, which will then use it to handle schema dereferencing internally.
The original schema remains unchanged—schemas are dereferenced at runtime only when needed.
This approach makes it easier to support and manage recursive schemas.

const schema = {
  "type": "object",
  "properties": {
    "user": {
      "$ref": "#/$defs/user"
    }
  },
  "$defs": {
    "user": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    }
  }
}

const refParser = new Jedison.RefParser()

const init = async () => {
  await refParser.dereference(schema)

  const jedison = new Jedison.Create({
    container: document.querySelector('#jedison-container'),
    theme: new Jedison.ThemeBootstrap5(),
    refParser: refParser,
    schema: schema
  })
}

init()

Before Dereferencing

The "user" property schema has not been dereferenced, so the editor only sees an empty schema.
Since there's no defined type, the schema is interpreted as allowing any JSON type.
As a result, Jedison displays a multiple editor, enabling the user to select from all possible JSON types.

After Dereferencing

The "user" property schema has been dereferenced and has now type.
As a result, Jedison renders a object editor.

Recursive schema

Jedison can handle recursive JSON Schemas, provided certain conditions are met.
In this example, we use the x-deactivateNonRequired keyword, which requires properties to be added manually.
To support this, the Jedison option enablePropertiesToggle: true allows manual activation of properties.
This setup is necessary to prevent infinite recursion during schema processing.

In some cases, handling recursion is easier—for example, when the recursive $ref is inside an "items" schema.
This is because the schema is only instantiated at runtime when a new item is added to the array.