Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1321 from ajv-validator/dynamic-ref
Dynamic recursive references
- Loading branch information
Showing
34 changed files
with
845 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type Ajv from "../../ajv" | ||
import type {SchemaObject} from "../../ajv" | ||
import metaSchema from "./schema.json" | ||
import metaApplicator from "./meta/applicator.json" | ||
import metaContent from "./meta/content.json" | ||
import metaCore from "./meta/core.json" | ||
import metaFormat from "./meta/format.json" | ||
import metaMetadata from "./meta/meta-data.json" | ||
import metaValidation from "./meta/validation.json" | ||
|
||
export default function addMetaSchema2019(ajv: Ajv, setDefault?: boolean): Ajv { | ||
;[ | ||
metaSchema, | ||
metaApplicator, | ||
metaContent, | ||
metaCore, | ||
metaFormat, | ||
metaMetadata, | ||
metaValidation, | ||
].forEach(addMeta) | ||
if (setDefault) ajv.opts.defaultMeta = "https://json-schema.org/draft/2019-09/schema" | ||
return ajv | ||
|
||
function addMeta(sch: SchemaObject): void { | ||
ajv.addMetaSchema(sch, undefined, false) | ||
} | ||
} |
Oops, something went wrong.