@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 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 = []; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
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 = []; // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
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;