json-schema-ref-parser
json-schema-ref-parser copied to clipboard
Parse, Resolve, and Dereference JSON Schema $ref pointers in Node and browsers
We are using the `json-schema-ref-parser` library to flatten / dereference our schemas. As we need to return them over an API, we use `bundle()` as sometimes circular references can occur...
We are using a `$defs` section in our schemas. Schemas within the `$defs` section are referenced via local file references, and these schemas can themselves have cross references to other...
**Sample** https://github.com/phawxby/json-ref-example/blob/main/src/example.ts What I think is happening here is that the repetition of the reference to `root.schema.json` is being resolved down to `$refs` in later references. However because those sub...
Beside of ignoring or throwing error, could be really nice if you could executed a call back function when a circular reference is found. A call similar to `onDereference` ....
I thought this was the ultimate solution to bundle all my local stuff and leave external refs alone. ```ts let bundledSchema = await $RefParser.bundle(schema, { resolve: { external: false, //...
I have a json file with some refs that are wrong. I want to load it and bundle everything except those missing refs. like: ```json { "$ref": "../file/that/not/exists.yaml" } ```...
**Expected behavior:** When set to "relative", relative paths should resolve relative to the directory. So this ref: `$ref: "./_shared/components.yaml#/components/schemas/uint256"` should resolve to: `/_shared/components.yaml#/components/schemas/uint256` **Actual behavior:** It always resolves against the...
Currently, this project relies on [JSON.parse](https://github.com/APIDevTools/json-schema-ref-parser/blob/da0fda28cbb67ce6f62d073576c6af3e53417b29/lib/parsers/json.ts#L43) to load JSON files. However, `JSON.parse` is lossy on numbers larger than `Number.MAX_SAFE_INTEGER` ex: ```ts console.log( JSON.parse(`${Number.MAX_SAFE_INTEGER + 2}`) ); ``` Correct output: `9007199254740993`...
# What works The given schema ```json { "$id": "recursive.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "properties": { "label": { "anyOf": [ { "type": "integer" } ] }, "value": { "$ref": "#" } },...
We have to process a bunch of json schemas produced by another team and **bundled** using [`@hyperjump/json-schema`](https://github.com/hyperjump-io/json-schema). For reference (pun intended) here is a simple sample of such bundles. ```json...