@redocly/openapi-core 0.0.0-snapshot.1737554067 → 0.0.0-snapshot.1737627998
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/rules/ajv.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.releaseAjvInstance = releaseAjvInstance;
|
|
4
4
|
exports.validateJsonSchema = validateJsonSchema;
|
|
5
5
|
const _2020_1 = require("@redocly/ajv/dist/2020");
|
|
6
|
+
const ajv_formats_1 = require("ajv-formats");
|
|
6
7
|
const ref_utils_1 = require("../ref-utils");
|
|
7
8
|
let ajvInstance = null;
|
|
8
9
|
function releaseAjvInstance() {
|
|
@@ -19,7 +20,7 @@ function getAjv(resolve, allowAdditionalProperties) {
|
|
|
19
20
|
validateSchema: false,
|
|
20
21
|
discriminator: true,
|
|
21
22
|
allowUnionTypes: true,
|
|
22
|
-
validateFormats:
|
|
23
|
+
validateFormats: true,
|
|
23
24
|
defaultUnevaluatedProperties: allowAdditionalProperties,
|
|
24
25
|
loadSchemaSync(base, $ref, $id) {
|
|
25
26
|
const resolvedRef = resolve({ $ref }, base.split('#')[0]);
|
|
@@ -29,6 +30,7 @@ function getAjv(resolve, allowAdditionalProperties) {
|
|
|
29
30
|
},
|
|
30
31
|
logger: false,
|
|
31
32
|
});
|
|
33
|
+
(0, ajv_formats_1.default)(ajvInstance); // FIXME: type mismatch
|
|
32
34
|
}
|
|
33
35
|
return ajvInstance;
|
|
34
36
|
}
|
|
@@ -27,7 +27,7 @@ const ValidContentExamples = (opts) => {
|
|
|
27
27
|
location = isMultiple ? resolved.location.child('value') : resolved.location;
|
|
28
28
|
example = resolved.node;
|
|
29
29
|
}
|
|
30
|
-
if (isMultiple && typeof example
|
|
30
|
+
if (isMultiple && typeof example?.value === 'undefined') {
|
|
31
31
|
return;
|
|
32
32
|
}
|
|
33
33
|
(0, utils_1.validateExample)(isMultiple ? example.value : example, mediaType.schema, location, ctx, allowAdditionalProperties);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@redocly/openapi-core",
|
|
3
|
-
"version": "0.0.0-snapshot.
|
|
3
|
+
"version": "0.0.0-snapshot.1737627998",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"engines": {
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@redocly/ajv": "^8.11.2",
|
|
39
39
|
"@redocly/config": "^0.20.1",
|
|
40
|
+
"ajv-formats": "^3.0.1",
|
|
40
41
|
"colorette": "^1.2.0",
|
|
41
42
|
"https-proxy-agent": "^7.0.4",
|
|
42
43
|
"js-levenshtein": "^1.1.6",
|