json-schema-library 11.6.2 → 11.6.4
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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/jlib.js +1 -3
- package/package.json +2 -2
- package/pnpm-workspace.yaml +2 -0
- package/src/SchemaNode.ts +7 -2
- package/src/utils/resolveUri.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "json-schema-library",
|
|
3
|
-
"version": "11.6.
|
|
3
|
+
"version": "11.6.4",
|
|
4
4
|
"description": "Customizable and hackable json-validator and json-schema utilities for traversal, data generation and validation",
|
|
5
5
|
"types": "./dist/index.d.cts",
|
|
6
6
|
"exports": {
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"@sagold/json-pointer": "^7.2.1",
|
|
104
104
|
"fast-copy": "^4.0.4",
|
|
105
105
|
"fast-deep-equal": "^3.1.3",
|
|
106
|
-
"uri
|
|
106
|
+
"fast-uri": "^4.2.1",
|
|
107
107
|
"valid-url": "^1.0.9"
|
|
108
108
|
},
|
|
109
109
|
"resolutions": {
|
package/src/SchemaNode.ts
CHANGED
|
@@ -583,15 +583,20 @@ export const SchemaNodeMethods = {
|
|
|
583
583
|
schemaValidation = sanitizeErrors(schemaValidation);
|
|
584
584
|
const schemaErrors: JsonError[] = [];
|
|
585
585
|
const schemaAnnotations: JsonAnnotation[] = [];
|
|
586
|
+
const remoteSchemaId = remoteNode.context.rootNode.$id ?? resolveUri(url);
|
|
586
587
|
schemaValidation.forEach((error) => {
|
|
587
588
|
if (isJsonError(error)) {
|
|
589
|
+
error.data.schemaId = remoteSchemaId;
|
|
588
590
|
schemaErrors.push(error);
|
|
589
591
|
} else if (isJsonAnnotation(error)) {
|
|
592
|
+
error.data.schemaId = remoteSchemaId;
|
|
590
593
|
schemaAnnotations.push(error);
|
|
591
594
|
}
|
|
592
595
|
});
|
|
593
|
-
|
|
594
|
-
|
|
596
|
+
// accumulate diagnostics instead of overwriting so that registering
|
|
597
|
+
// multiple remotes retains all of their errors/annotations, see #116
|
|
598
|
+
node.schemaErrors = (node.schemaErrors ?? []).concat(schemaErrors);
|
|
599
|
+
node.schemaAnnotations = (node.schemaAnnotations ?? []).concat(schemaAnnotations);
|
|
595
600
|
|
|
596
601
|
return node;
|
|
597
602
|
},
|
package/src/utils/resolveUri.ts
CHANGED