@takeshape/schema 9.43.0 → 9.46.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.
@@ -611,8 +611,8 @@ function getArgsShapeSchema(context, argsSchema) {
611
611
  const createShapeToPropertySchema = (projectSchema, definitions, definitionNames, {
612
612
  useShapeIdDiscriminator
613
613
  }) => {
614
- const rewriteRefs = (shape, addDiscriminator = false) => {
615
- const handleSchema = (propSchema, addDiscriminator = false) => {
614
+ const rewriteRefs = shape => {
615
+ const handleSchema = propSchema => {
616
616
  // Unwrap array schema
617
617
  propSchema = propSchema.items ?? propSchema;
618
618
 
@@ -627,7 +627,7 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
627
627
  }
628
628
 
629
629
  propSchema.oneOf.forEach(schema => {
630
- handleSchema(schema, isUnion);
630
+ handleSchema(schema);
631
631
  });
632
632
  return;
633
633
  } // Add workflow validation
@@ -654,7 +654,7 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
654
654
 
655
655
  if (!definitionNames.has(shapeName)) {
656
656
  definitionNames.add(shapeName);
657
- const rewritten = rewriteRefs(shape, addDiscriminator);
657
+ const rewritten = rewriteRefs(shape);
658
658
 
659
659
  if (useShapeIdDiscriminator && (0, _utils.isObjectSchema)(rewritten)) {
660
660
  rewritten.properties._shapeId = {
@@ -682,7 +682,7 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
682
682
 
683
683
  const shapeSchemaCopy = (0, _refs.dereferenceObjectSchema)(projectSchema, shapeSchema);
684
684
 
685
- if (useShapeIdDiscriminator && addDiscriminator && shape.title) {
685
+ if (shape.title) {
686
686
  shapeSchemaCopy.title = shape.title;
687
687
  }
688
688
 
package/es/schema-util.js CHANGED
@@ -485,8 +485,8 @@ export function getArgsShapeSchema(context, argsSchema) {
485
485
  const createShapeToPropertySchema = (projectSchema, definitions, definitionNames, {
486
486
  useShapeIdDiscriminator
487
487
  }) => {
488
- const rewriteRefs = (shape, addDiscriminator = false) => {
489
- const handleSchema = (propSchema, addDiscriminator = false) => {
488
+ const rewriteRefs = shape => {
489
+ const handleSchema = propSchema => {
490
490
  // Unwrap array schema
491
491
  propSchema = propSchema.items ?? propSchema;
492
492
 
@@ -501,7 +501,7 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
501
501
  }
502
502
 
503
503
  propSchema.oneOf.forEach(schema => {
504
- handleSchema(schema, isUnion);
504
+ handleSchema(schema);
505
505
  });
506
506
  return;
507
507
  } // Add workflow validation
@@ -528,7 +528,7 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
528
528
 
529
529
  if (!definitionNames.has(shapeName)) {
530
530
  definitionNames.add(shapeName);
531
- const rewritten = rewriteRefs(shape, addDiscriminator);
531
+ const rewritten = rewriteRefs(shape);
532
532
 
533
533
  if (useShapeIdDiscriminator && isObjectSchema(rewritten)) {
534
534
  rewritten.properties._shapeId = {
@@ -556,7 +556,7 @@ const createShapeToPropertySchema = (projectSchema, definitions, definitionNames
556
556
 
557
557
  const shapeSchemaCopy = dereferenceObjectSchema(projectSchema, shapeSchema);
558
558
 
559
- if (useShapeIdDiscriminator && addDiscriminator && shape.title) {
559
+ if (shape.title) {
560
560
  shapeSchemaCopy.title = shape.title;
561
561
  }
562
562