json-machete 0.6.0-alpha-d4888db4e.0 → 0.6.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.
Files changed (3) hide show
  1. package/index.js +5 -0
  2. package/index.mjs +5 -0
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -603,6 +603,11 @@ async function healJSONSchema(schema) {
603
603
  delete subSchema.format;
604
604
  }
605
605
  }
606
+ if (subSchema.required) {
607
+ if (!Array.isArray(subSchema.required)) {
608
+ delete subSchema.required;
609
+ }
610
+ }
606
611
  // If it is an object type but no properties given while example is available
607
612
  if (subSchema.type === 'object' && !subSchema.properties && subSchema.example) {
608
613
  const generatedSchema = toJsonSchema(subSchema.example, {
package/index.mjs CHANGED
@@ -598,6 +598,11 @@ async function healJSONSchema(schema) {
598
598
  delete subSchema.format;
599
599
  }
600
600
  }
601
+ if (subSchema.required) {
602
+ if (!Array.isArray(subSchema.required)) {
603
+ delete subSchema.required;
604
+ }
605
+ }
601
606
  // If it is an object type but no properties given while example is available
602
607
  if (subSchema.type === 'object' && !subSchema.properties && subSchema.example) {
603
608
  const generatedSchema = toJsonSchema(subSchema.example, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-machete",
3
- "version": "0.6.0-alpha-d4888db4e.0",
3
+ "version": "0.6.0",
4
4
  "sideEffects": false,
5
5
  "dependencies": {
6
6
  "@graphql-mesh/utils": "0.30.2",