|
1 | 1 | # json-schema-ref-resolver
|
2 | 2 |
|
| 3 | +[](https://github.com/fastify/json-schema-ref-resolver/actions/workflows/ci.yml) |
| 4 | +[](https://www.npmjs.com/package/json-schema-ref-resolver) |
| 5 | +[](https://github.com/neostandard/neostandard) |
| 6 | + |
3 | 7 | __json-schema-ref-resolver__ is a javascript library that resolves references in [JSON schemas](https://json-schema.org/draft/2020-12/json-schema-core#name-introduction).
|
4 | 8 |
|
5 | 9 | - [Installation](#installation)
|
@@ -255,7 +259,7 @@ assert.deepStrictEqual(dependencies, { targetSchema1, targetSchema2 })
|
255 | 259 |
|
256 | 260 | #### derefSchema(schemaId)
|
257 | 261 |
|
258 |
| -Dereferences all references in the schema. All dependency also will be dereferenced. If schema with the specified id is not found, an error will be thrown. |
| 262 | +Dereferences all references in the schema. All dependencies will also be dereferenced. If schema with the specified id is not found, an error will be thrown. |
259 | 263 |
|
260 | 264 | - `schemaId` __\<string\>__ - schema id of the schema to dereference.
|
261 | 265 |
|
@@ -361,7 +365,7 @@ assert.deepStrictEqual(derefSourceSchema, {
|
361 | 365 |
|
362 | 366 | #### Caveats
|
363 | 367 |
|
364 |
| -- If a reference schema and a source schema have a key with the same name and different values, an error will be throwing during a call to `derefSchema` or `getDerefSchema`. |
| 368 | +- If a reference schema and a source schema have a key with the same name and different values, an error will be thrown during a call to `derefSchema` or `getDerefSchema`. |
365 | 369 |
|
366 | 370 | _Example:_
|
367 | 371 |
|
@@ -396,3 +400,7 @@ refResolver.addSchema(sourceSchema)
|
396 | 400 |
|
397 | 401 | refResolver.derefSchema('sourceSchema') // Throws an error
|
398 | 402 | ```
|
| 403 | + |
| 404 | +## License |
| 405 | + |
| 406 | +Licensed under [MIT](./LICENSE). |
0 commit comments