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()