Skip to content

Commit ff34113

Browse files
committed
use ajv-draft-04
1 parent 7d2f87d commit ff34113

File tree

7 files changed

+277
-501
lines changed

7 files changed

+277
-501
lines changed

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const Ajv = require("ajv");
1+
const Ajv04 = require("ajv-draft-04");
22
const Ajv2020 = require("ajv/dist/2020.js");
33
const JSYaml = require("js-yaml");
44
const util = require("util");
@@ -9,7 +9,7 @@ const { resolve } = require("./resolve.js");
99

1010
const openApiVersions = new Set(["2.0", "3.0", "3.1"]);
1111
const ajvVersions = {
12-
"http://json-schema.org/draft-07/schema": Ajv,
12+
"http://json-schema.org/draft-04/schema#": Ajv04,
1313
"https://json-schema.org/draft/2020-12/schema": Ajv2020,
1414
};
1515

package-lock.json

+20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"type": "commonjs",
77
"dependencies": {
88
"ajv": "^8.6.0",
9+
"ajv-draft-04": "^1.0.0",
910
"js-yaml": "^4.1.0"
1011
},
1112
"scripts": {

schemas/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# The schemas
22
This folder contain the JSON schemas for the openApi specifications as used by this package.
3-
The original schemas from the [openApi specification repository](https://github.com/OAI/OpenAPI-Specification) have been slightly modified to work with the current AJV version that this package uses.
3+
The original OAS 3.1 schemas from the [openApi specification repository](https://github.com/OAI/OpenAPI-Specification) have been slightly modified to work with the current AJV version that this package uses.
44
This means:
5-
- migrating schemas from JSONschema-draft-04 to JSONschema-draft-07 as AJV does not support draft-04 anymore.
6-
- replacing $dynamicRefs by normal $refs as the current version of AJV has an issue with resolving $dynamicRefs outside the root object.
5+
- replacing $dynamicRefs by normal $refs as the current version of AJV has an issue with resolving $dynamicRefs outside the root object in draft-2020-12 specs.
76

0 commit comments

Comments
 (0)