@takeshape/schema 8.20.2 → 8.24.0
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/es/schema-util.js +4 -0
- package/es/validate.js +3 -6
- package/examples/dependencies/fabric-ecommerce.json +9716 -0
- package/examples/dependencies/pruned-shopify-product-schema.json +9672 -0
- package/examples/dependencies/shopify-store-with-widget.json +9854 -0
- package/examples/dependencies/stripe-starter-resolved.json +27345 -0
- package/examples/latest/fabric-ecommerce.json +8901 -119
- package/examples/latest/pruned-shopify-product-schema.json +2835 -2496
- package/examples/latest/rick-and-morty-ast.json +1 -1
- package/examples/latest/shopify-store-with-widget.json +4532 -4234
- package/examples/latest/stripe-starter-resolved.json +20090 -12155
- package/examples/source/fabric-ecommerce.json +0 -894
- package/examples/source/pruned-shopify-product-schema.json +1 -9333
- package/examples/source/shopify-store-with-widget.json +0 -8953
- package/examples/source/stripe-starter-resolved.json +0 -19409
- package/lib/schema-util.d.ts.map +1 -1
- package/lib/schema-util.js +4 -0
- package/lib/validate.d.ts.map +1 -1
- package/lib/validate.js +3 -6
- package/package.json +4 -4
package/es/schema-util.js
CHANGED
|
@@ -593,6 +593,10 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
|
|
|
593
593
|
return shapeSchema;
|
|
594
594
|
}
|
|
595
595
|
|
|
596
|
+
if (shapeSchema.enum) {
|
|
597
|
+
return shapeSchema;
|
|
598
|
+
}
|
|
599
|
+
|
|
596
600
|
const shapeSchemaCopy = dereferenceObjectSchema(projectSchema, shapeSchema);
|
|
597
601
|
|
|
598
602
|
if (useShapeIdDiscriminator) {
|
package/es/validate.js
CHANGED
|
@@ -331,10 +331,8 @@ function validateRefs(projectSchema, additionalShapeNames = builtInShapeNames) {
|
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
function validateDirectives(projectSchema, additionalShapeIds = builtInModelShapeIds) {
|
|
334
|
-
const errors = [];
|
|
335
|
-
|
|
336
|
-
const projectShapeIds = new Set([...getModelShapeIds(projectSchema.shapes), ...additionalShapeIds]); // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
|
337
|
-
|
|
334
|
+
const errors = [];
|
|
335
|
+
const projectShapeIds = new Set([...getModelShapeIds(projectSchema.shapes), ...additionalShapeIds]);
|
|
338
336
|
visitShapeProperties(projectSchema.shapes, (schema, path) => {
|
|
339
337
|
if (schema['@relationship']) {
|
|
340
338
|
var _schema$Relationship;
|
|
@@ -366,8 +364,7 @@ function validateDirectives(projectSchema, additionalShapeIds = builtInModelShap
|
|
|
366
364
|
}
|
|
367
365
|
|
|
368
366
|
function validateOneOfs(projectSchema) {
|
|
369
|
-
const errors = [];
|
|
370
|
-
|
|
367
|
+
const errors = [];
|
|
371
368
|
visitShapeProperties(projectSchema.shapes, (schema, path) => {
|
|
372
369
|
const oneOfPath = schema.items ? ['items', 'oneOf'] : ['oneOf'];
|
|
373
370
|
schema = schema.items ? schema.items : schema;
|