@sdk-it/spec 0.47.4 → 0.48.1

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.
@@ -12,4 +12,13 @@ export declare function isInlinable(spec: OpenAPIDocument, $ref: string): boolea
12
12
  * components, so a generator must defer the reference that closes the cycle.
13
13
  */
14
14
  export declare function isRecursiveRef(spec: OpenAPIDocument, $ref: string): boolean;
15
+ /**
16
+ * The property that selects the branch of `schema`'s `oneOf` or `anyOf`, when
17
+ * the branches are objects that require it and each gives it values no other
18
+ * branch gives, so at most one branch can match any value. A generator may
19
+ * then validate by that property, since OpenAPI 3.2 says a `discriminator`
20
+ * MUST NOT change the validation outcome. Branches that leave the property
21
+ * open, as the Pet store's `petType: { type: 'string' }`, give `undefined`.
22
+ */
23
+ export declare function discriminatorOf(spec: OpenAPIDocument, schema: SchemaObject): string | undefined;
15
24
  //# sourceMappingURL=is-primitive-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"is-primitive-schema.d.ts","sources":["../../src/lib/is-primitive-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMpD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,WAMrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQ3E"}
1
+ {"version":3,"file":"is-primitive-schema.d.ts","sources":["../../src/lib/is-primitive-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMpD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,YAAY,WAMrD;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAMxE;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAQ3E;AA0BD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,eAAe,EACrB,MAAM,EAAE,YAAY,GACnB,MAAM,GAAG,SAAS,CAoBpB"}
@@ -1,4 +1,4 @@
1
- import { followRef, isRef } from "@sdk-it/core/ref.js";
1
+ import { followRef, isRef, resolveRef } from "@sdk-it/core/ref.js";
2
2
  import { coerceTypes } from "./is.js";
3
3
  import { subschemas } from "./walk-schemas.js";
4
4
  function isPrimitiveSchema(schema) {
@@ -37,7 +37,41 @@ function reaches(spec, schema, $ref, seen, through) {
37
37
  }
38
38
  return false;
39
39
  }
40
+ function discriminatorOf(spec, schema) {
41
+ const propertyName = schema.discriminator?.propertyName;
42
+ if (schema.oneOf && schema.anyOf) return void 0;
43
+ const branches = schema.oneOf ?? schema.anyOf;
44
+ if (typeof propertyName !== "string" || !branches?.length) return void 0;
45
+ const seen = /* @__PURE__ */ new Set();
46
+ for (const branch of branches) {
47
+ const values = discriminatorValues(
48
+ spec,
49
+ resolveRef(spec, branch),
50
+ propertyName
51
+ );
52
+ if (!values) return void 0;
53
+ for (const value of values) {
54
+ if (seen.has(value)) return void 0;
55
+ seen.add(value);
56
+ }
57
+ }
58
+ return propertyName;
59
+ }
60
+ function discriminatorValues(spec, branch, propertyName) {
61
+ if (branch.type !== "object" || "nullable" in branch && branch.nullable || branch.default !== void 0 || branch.allOf || branch.anyOf || branch.oneOf || !branch.required?.includes(propertyName)) {
62
+ return void 0;
63
+ }
64
+ const property = branch.properties?.[propertyName];
65
+ if (!property) return void 0;
66
+ const { const: value, enum: values } = resolveRef(spec, property);
67
+ const literals = value !== void 0 ? [value] : values?.length ? values : void 0;
68
+ return literals?.every(isLiteral) ? literals : void 0;
69
+ }
70
+ function isLiteral(value) {
71
+ return value === null || ["string", "number", "boolean"].includes(typeof value);
72
+ }
40
73
  export {
74
+ discriminatorOf,
41
75
  isInlinable,
42
76
  isPrimitiveSchema,
43
77
  isRecursiveRef
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/lib/is-primitive-schema.ts"],
4
- "sourcesContent": ["import type { SchemaObject } from 'openapi3-ts/oas31';\n\nimport type { OpenAPIDocument } from '@sdk-it/core';\nimport { followRef, isRef } from '@sdk-it/core/ref.js';\n\nimport { coerceTypes } from './is.js';\nimport { subschemas } from './walk-schemas.js';\n\nexport function isPrimitiveSchema(schema: SchemaObject) {\n const types = coerceTypes(schema, false);\n if (!types || types.length === 0) {\n return false;\n }\n return types.includes('object') === false;\n}\n\n/**\n * Whether a generator may write the component `$ref` points at in place\n * instead of naming it: a primitive that does not reach itself through other\n * primitives, since inlining a cycle never ends.\n */\nexport function isInlinable(spec: OpenAPIDocument, $ref: string): boolean {\n const target = followRef<SchemaObject>(spec, $ref);\n return (\n isPrimitiveSchema(target) &&\n !reaches(spec, target, $ref, new Set(), isPrimitiveSchema)\n );\n}\n\n/**\n * Whether the component `$ref` points at refers back to itself through other\n * components, so a generator must defer the reference that closes the cycle.\n */\nexport function isRecursiveRef(spec: OpenAPIDocument, $ref: string): boolean {\n return reaches(\n spec,\n followRef<SchemaObject>(spec, $ref),\n $ref,\n new Set(),\n () => true,\n );\n}\n\n/** Whether `schema` refers to `$ref`, following each component `through` accepts. */\nfunction reaches(\n spec: OpenAPIDocument,\n schema: SchemaObject,\n $ref: string,\n seen: Set<string>,\n through: (component: SchemaObject) => boolean,\n): boolean {\n for (const [, child] of subschemas(schema)) {\n if (!isRef(child)) {\n if (reaches(spec, child, $ref, seen, through)) return true;\n continue;\n }\n if (child.$ref === $ref) return true;\n if (seen.has(child.$ref)) continue;\n seen.add(child.$ref);\n const target = followRef<SchemaObject>(spec, child.$ref);\n if (through(target) && reaches(spec, target, $ref, seen, through)) {\n return true;\n }\n }\n return false;\n}\n"],
5
- "mappings": "AAGA,SAAS,WAAW,aAAa;AAEjC,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAEpB,SAAS,kBAAkB,QAAsB;AACtD,QAAM,QAAQ,YAAY,QAAQ,KAAK;AACvC,MAAI,CAAC,SAAS,MAAM,WAAW,GAAG;AAChC,WAAO;AAAA,EACT;AACA,SAAO,MAAM,SAAS,QAAQ,MAAM;AACtC;AAOO,SAAS,YAAY,MAAuB,MAAuB;AACxE,QAAM,SAAS,UAAwB,MAAM,IAAI;AACjD,SACE,kBAAkB,MAAM,KACxB,CAAC,QAAQ,MAAM,QAAQ,MAAM,oBAAI,IAAI,GAAG,iBAAiB;AAE7D;AAMO,SAAS,eAAe,MAAuB,MAAuB;AAC3E,SAAO;AAAA,IACL;AAAA,IACA,UAAwB,MAAM,IAAI;AAAA,IAClC;AAAA,IACA,oBAAI,IAAI;AAAA,IACR,MAAM;AAAA,EACR;AACF;AAGA,SAAS,QACP,MACA,QACA,MACA,MACA,SACS;AACT,aAAW,CAAC,EAAE,KAAK,KAAK,WAAW,MAAM,GAAG;AAC1C,QAAI,CAAC,MAAM,KAAK,GAAG;AACjB,UAAI,QAAQ,MAAM,OAAO,MAAM,MAAM,OAAO,EAAG,QAAO;AACtD;AAAA,IACF;AACA,QAAI,MAAM,SAAS,KAAM,QAAO;AAChC,QAAI,KAAK,IAAI,MAAM,IAAI,EAAG;AAC1B,SAAK,IAAI,MAAM,IAAI;AACnB,UAAM,SAAS,UAAwB,MAAM,MAAM,IAAI;AACvD,QAAI,QAAQ,MAAM,KAAK,QAAQ,MAAM,QAAQ,MAAM,MAAM,OAAO,GAAG;AACjE,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;",
4
+ "sourcesContent": ["import type { SchemaObject } from 'openapi3-ts/oas31';\n\nimport type { OpenAPIDocument } from '@sdk-it/core';\nimport { followRef, isRef, resolveRef } from '@sdk-it/core/ref.js';\n\nimport { coerceTypes } from './is.js';\nimport { subschemas } from './walk-schemas.js';\n\nexport function isPrimitiveSchema(schema: SchemaObject) {\n const types = coerceTypes(schema, false);\n if (!types || types.length === 0) {\n return false;\n }\n return types.includes('object') === false;\n}\n\n/**\n * Whether a generator may write the component `$ref` points at in place\n * instead of naming it: a primitive that does not reach itself through other\n * primitives, since inlining a cycle never ends.\n */\nexport function isInlinable(spec: OpenAPIDocument, $ref: string): boolean {\n const target = followRef<SchemaObject>(spec, $ref);\n return (\n isPrimitiveSchema(target) &&\n !reaches(spec, target, $ref, new Set(), isPrimitiveSchema)\n );\n}\n\n/**\n * Whether the component `$ref` points at refers back to itself through other\n * components, so a generator must defer the reference that closes the cycle.\n */\nexport function isRecursiveRef(spec: OpenAPIDocument, $ref: string): boolean {\n return reaches(\n spec,\n followRef<SchemaObject>(spec, $ref),\n $ref,\n new Set(),\n () => true,\n );\n}\n\n/** Whether `schema` refers to `$ref`, following each component `through` accepts. */\nfunction reaches(\n spec: OpenAPIDocument,\n schema: SchemaObject,\n $ref: string,\n seen: Set<string>,\n through: (component: SchemaObject) => boolean,\n): boolean {\n for (const [, child] of subschemas(schema)) {\n if (!isRef(child)) {\n if (reaches(spec, child, $ref, seen, through)) return true;\n continue;\n }\n if (child.$ref === $ref) return true;\n if (seen.has(child.$ref)) continue;\n seen.add(child.$ref);\n const target = followRef<SchemaObject>(spec, child.$ref);\n if (through(target) && reaches(spec, target, $ref, seen, through)) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The property that selects the branch of `schema`'s `oneOf` or `anyOf`, when\n * the branches are objects that require it and each gives it values no other\n * branch gives, so at most one branch can match any value. A generator may\n * then validate by that property, since OpenAPI 3.2 says a `discriminator`\n * MUST NOT change the validation outcome. Branches that leave the property\n * open, as the Pet store's `petType: { type: 'string' }`, give `undefined`.\n */\nexport function discriminatorOf(\n spec: OpenAPIDocument,\n schema: SchemaObject,\n): string | undefined {\n const propertyName = schema.discriminator?.propertyName;\n // Both together keep JSON Schema's meaning of each, which no one zod union has.\n if (schema.oneOf && schema.anyOf) return undefined;\n const branches = schema.oneOf ?? schema.anyOf;\n if (typeof propertyName !== 'string' || !branches?.length) return undefined;\n const seen = new Set<unknown>();\n for (const branch of branches) {\n const values = discriminatorValues(\n spec,\n resolveRef(spec, branch),\n propertyName,\n );\n if (!values) return undefined;\n for (const value of values) {\n if (seen.has(value)) return undefined;\n seen.add(value);\n }\n }\n return propertyName;\n}\n\n/** The literal values `branch` gives `propertyName`, when `branch` is an object that requires it. */\nfunction discriminatorValues(\n spec: OpenAPIDocument,\n branch: SchemaObject,\n propertyName: string,\n): unknown[] | undefined {\n if (\n branch.type !== 'object' ||\n ('nullable' in branch && branch.nullable) ||\n branch.default !== undefined ||\n branch.allOf ||\n branch.anyOf ||\n branch.oneOf ||\n !branch.required?.includes(propertyName)\n ) {\n return undefined;\n }\n const property = branch.properties?.[propertyName];\n if (!property) return undefined;\n const { const: value, enum: values } = resolveRef(spec, property);\n const literals =\n value !== undefined ? [value] : values?.length ? values : undefined;\n return literals?.every(isLiteral) ? literals : undefined;\n}\n\n/** A value `z.literal` takes as a discriminator. */\nfunction isLiteral(value: unknown): boolean {\n return (\n value === null || ['string', 'number', 'boolean'].includes(typeof value)\n );\n}\n"],
5
+ "mappings": "AAGA,SAAS,WAAW,OAAO,kBAAkB;AAE7C,SAAS,mBAAmB;AAC5B,SAAS,kBAAkB;AAEpB,SAAS,kBAAkB,QAAsB;AACtD,QAAM,QAAQ,YAAY,QAAQ,KAAK;AACvC,MAAI,CAAC,SAAS,MAAM,WAAW,GAAG;AAChC,WAAO;AAAA,EACT;AACA,SAAO,MAAM,SAAS,QAAQ,MAAM;AACtC;AAOO,SAAS,YAAY,MAAuB,MAAuB;AACxE,QAAM,SAAS,UAAwB,MAAM,IAAI;AACjD,SACE,kBAAkB,MA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,MACA,QACA,cACuB;AACvB,MACE,OAAO,SAAS,YACf,cAAc,UAAU,OAAO,YAChC,OAAO,YAAY,UACnB,OAAO,SACP,OAAO,SACP,OAAO,SACP,CAAC,OAAO,UAAU,SAAS,YAAY,GACvC;AACA,WAAO;AAAA,EACT;AACA,QAAM,WAAW,OAAO,aAAa,YAAY;AACjD,MAAI,CAAC,SAAU,QAAO;AACtB,QAAM,EAAE,OAAO,OAAO,MAAM,OAAO,IAAI,WAAW,MAAM,QAAQ;AAChE,QAAM,WACJ,UAAU,SAAY,CAAC,KAAK,IAAI,QAAQ,SAAS,SAAS;AAC5D,SAAO,UAAU,MAAM,SAAS,IAAI,WAAW;AACjD;AAGA,SAAS,UAAU,OAAyB;AAC1C,SACE,UAAU,QAAQ,CAAC,UAAU,UAAU,SAAS,EAAE,SAAS,OAAO,KAAK;AAE3E;",
6
6
  "names": []
7
7
  }
@@ -23,8 +23,8 @@ function normalizeSchemaObjects(spec, schemas, visited = /* @__PURE__ */ new Set
23
23
  delete schema.anyOf;
24
24
  normalizeSchemaObjects(spec, Object.values(schema.properties), visited);
25
25
  for (const [key, value] of Object.entries(schema.properties)) {
26
- if (notRef(value) && isPrimitiveSchema(value)) {
27
- value.default ??= schema.default?.[key];
26
+ if (notRef(value) && isPrimitiveSchema(value) && schema.default?.[key] !== void 0) {
27
+ value.default ??= schema.default[key];
28
28
  delete schema.default?.[key];
29
29
  }
30
30
  }
@@ -72,9 +72,6 @@ function normalizeSchemaObjects(spec, schemas, visited = /* @__PURE__ */ new Set
72
72
  }
73
73
  delete schema.allOf;
74
74
  }
75
- if (schema.const !== void 0) {
76
- schema.default = schema.const;
77
- }
78
75
  if (!isEmpty(schema.allOf)) {
79
76
  const schemas2 = schema.allOf;
80
77
  const resolved = schemas2.map(
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/lib/processing-plugins/normalize-schemas.ts"],
4
- "sourcesContent": ["import { mergeWith, uniq } from 'lodash-es';\nimport assert from 'node:assert';\nimport type {\n ReferenceObject,\n SchemaObject,\n SchemaObjectType,\n} from 'openapi3-ts/oas31';\n\nimport { isEmpty, isRef, notRef, resolveRef, snakecase } from '@sdk-it/core';\n\nimport { findVarients } from '../find-polymorphic-varients.js';\nimport { formatName } from '../format-name.js';\nimport { isPrimitiveSchema } from '../is-primitive-schema.js';\nimport { coerceTypes } from '../is.js';\nimport type { IRPlugin } from '../processing.js';\nimport type { IR } from '../types.js';\n\nfunction normalizeSchemaObjects(\n spec: IR,\n schemas: (SchemaObject | ReferenceObject)[],\n visited = new Set<string>(),\n) {\n for (const schema of schemas) {\n if (isRef(schema)) continue;\n\n // JSON Schema lists required names on the parent object. An OAS 3.0 style\n // `required: true` on a property moves there; any other non-array\n // `required` (a boolean on the schema itself) says nothing and goes.\n if (schema.required !== undefined && !Array.isArray(schema.required)) {\n delete schema.required;\n }\n for (const [key, property] of Object.entries(schema.properties ?? {})) {\n // The document breaks its own type here, so read the value as it is.\n const flag: unknown = notRef(property) ? property.required : undefined;\n if (flag === true) {\n schema.required = uniq([...(schema.required ?? []), key]);\n }\n }\n\n if (!isEmpty(schema.properties)) {\n schema.type ??= 'object';\n delete schema.oneOf;\n delete schema.anyOf;\n normalizeSchemaObjects(spec, Object.values(schema.properties), visited);\n for (const [key, value] of Object.entries(schema.properties)) {\n if (notRef(value) && isPrimitiveSchema(value)) {\n value.default ??= schema.default?.[key];\n delete schema.default?.[key];\n }\n }\n delete schema.default;\n }\n\n if (!isEmpty(schema['x-properties'])) {\n normalizeSchemaObjects(\n spec,\n Object.values(schema['x-properties']),\n visited,\n );\n }\n\n if (!isEmpty(schema.items)) {\n delete schema.oneOf;\n delete schema.anyOf;\n schema.type = 'array';\n normalizeSchemaObjects(spec, [schema.items], visited);\n const items = resolveRef<SchemaObject>(spec, schema.items);\n if (Array.isArray(items.default)) {\n schema.default ??= structuredClone(items.default);\n }\n delete items.default;\n }\n\n if (!isEmpty(schema.anyOf) && !isEmpty(schema.oneOf)) {\n delete schema.anyOf;\n }\n\n if (isEmpty(schema.enum)) {\n delete schema.enum;\n }\n\n if (!isEmpty(schema.enum)) {\n if (schema.enum.length === 1) {\n schema.const = schema.enum[0];\n delete schema.enum;\n } else {\n const valuesSet = new Set<string>();\n const valuesList = [];\n for (const value of schema.enum) {\n const formattedValue = formatName(snakecase(formatName(value)));\n if (!valuesSet.has(formattedValue)) {\n valuesSet.add(formattedValue);\n valuesList.push(value);\n }\n }\n schema.enum = valuesList;\n }\n delete schema.allOf;\n }\n\n if (schema.const !== undefined) {\n schema.default = schema.const;\n }\n\n if (!isEmpty(schema.allOf)) {\n const schemas = schema.allOf;\n const resolved = schemas.map((item) =>\n resolveRef<SchemaObject>(spec, item),\n );\n const hasObjects = resolved.some((item) => item.type === 'object');\n const hasOtherTypes = resolved.some(\n (item) => item.type && item.type !== 'object',\n );\n if (hasObjects && hasOtherTypes) {\n assert(false, `allOf must be an object`);\n }\n mergeWith(\n schema,\n ...resolved.map((resolvedSchema, index) => {\n const sourceSchema = schemas[index];\n if (isRef(sourceSchema)) {\n if (visited.has(sourceSchema.$ref)) {\n throw new Error(\n `Circular allOf reference detected: ${[\n ...visited,\n sourceSchema.$ref,\n ].join(' -> ')}`,\n );\n }\n normalizeSchemaObjects(\n spec,\n [resolvedSchema],\n new Set(visited).add(sourceSchema.$ref),\n );\n } else {\n normalizeSchemaObjects(spec, [resolvedSchema], visited);\n }\n return resolvedSchema;\n }),\n unionRequired,\n );\n delete schema.allOf;\n } else {\n delete schema.allOf;\n }\n\n if (\n schema.type === 'object' &&\n isEmpty(schema.properties) &&\n typeof schema.additionalProperties === 'object' &&\n !isEmpty(schema.additionalProperties) &&\n notRef(schema.additionalProperties) &&\n !isEmpty(schema.additionalProperties.properties)\n ) {\n normalizeSchemaObjects(\n spec,\n Object.values(schema.additionalProperties.properties),\n visited,\n );\n }\n\n for (const kind of ['oneOf', 'anyOf'] as const) {\n if (!isEmpty(schema[kind])) {\n delete schema.type;\n normalizeSchemaObjects(spec, schema[kind], visited);\n if (isEmpty(schema[kind])) {\n continue;\n }\n\n let enumSchemaIndex = -1;\n const enumValues: string[] = [];\n for (let index = 0; index < schema[kind].length; index++) {\n const item = schema[kind][index];\n if (notRef(item) && item.type === 'string') {\n if (item.enum && item.enum.length > 1) {\n enumValues.push(...item.enum);\n if (enumSchemaIndex === -1) {\n enumSchemaIndex = index;\n }\n }\n }\n }\n if (enumSchemaIndex !== -1) {\n const enumSchema = schema[kind][enumSchemaIndex];\n if (notRef(enumSchema)) {\n enumSchema.enum = uniq(enumValues);\n }\n schema[kind] = schema[kind].filter(\n (item, index) => index === enumSchemaIndex || isRef(item),\n );\n }\n const otherTypes = schema[kind].filter(\n (item) => resolveRef<SchemaObject>(spec, item).type !== 'null',\n );\n const [only] = otherTypes;\n const droppedNull = otherTypes.length !== schema[kind].length;\n // A $ref cannot carry null, so a nullable $ref keeps its union.\n if (otherTypes.length === 1 && !(droppedNull && isRef(only))) {\n Object.assign(schema, only);\n delete schema[kind];\n if (droppedNull && notRef(only)) {\n const types = coerceTypes(only, false);\n if (types.length) {\n const typesWithNull: SchemaObjectType[] = [...types, 'null'];\n schema.type = uniq(typesWithNull);\n }\n }\n continue;\n }\n\n schema['x-varients'] = findVarients(spec, schema[kind]);\n } else {\n delete schema[kind];\n }\n }\n }\n}\n\n// allOf is a conjunction, so a value must carry every part's required\n// properties; lodash's default merge would overwrite the arrays by index.\nfunction unionRequired(target: unknown, source: unknown, key: string) {\n if (key === 'required' && Array.isArray(target) && Array.isArray(source)) {\n return uniq([...target, ...source]);\n }\n return undefined;\n}\n\nexport function normalizeSchemas(): IRPlugin {\n return {\n name: 'normalize-schemas',\n process({ spec }) {\n normalizeSchemaObjects(spec, Object.values(spec.components.schemas));\n },\n };\n}\n"],
5
- "mappings": "AAAA,SAAS,WAAW,YAAY;AAChC,OAAO,YAAY;AAOnB,SAAS,SAAS,OAAO,QAAQ,YAAY,iBAAiB;AAE9D,SAAS,oBAAoB;AAC7B,S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,MAAM,QAAQ,MAAM,GAAG;AACxE,WAAO,KAAK,CAAC,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,EACpC;AACA,SAAO;AACT;AAEO,SAAS,mBAA6B;AAC3C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,EAAE,KAAK,GAAG;AAChB,6BAAuB,MAAM,OAAO,OAAO,KAAK,WAAW,OAAO,CAAC;AAAA,IACrE;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["import { mergeWith, uniq } from 'lodash-es';\nimport assert from 'node:assert';\nimport type {\n ReferenceObject,\n SchemaObject,\n SchemaObjectType,\n} from 'openapi3-ts/oas31';\n\nimport { isEmpty, isRef, notRef, resolveRef, snakecase } from '@sdk-it/core';\n\nimport { findVarients } from '../find-polymorphic-varients.js';\nimport { formatName } from '../format-name.js';\nimport { isPrimitiveSchema } from '../is-primitive-schema.js';\nimport { coerceTypes } from '../is.js';\nimport type { IRPlugin } from '../processing.js';\nimport type { IR } from '../types.js';\n\nfunction normalizeSchemaObjects(\n spec: IR,\n schemas: (SchemaObject | ReferenceObject)[],\n visited = new Set<string>(),\n) {\n for (const schema of schemas) {\n if (isRef(schema)) continue;\n\n // JSON Schema lists required names on the parent object. An OAS 3.0 style\n // `required: true` on a property moves there; any other non-array\n // `required` (a boolean on the schema itself) says nothing and goes.\n if (schema.required !== undefined && !Array.isArray(schema.required)) {\n delete schema.required;\n }\n for (const [key, property] of Object.entries(schema.properties ?? {})) {\n // The document breaks its own type here, so read the value as it is.\n const flag: unknown = notRef(property) ? property.required : undefined;\n if (flag === true) {\n schema.required = uniq([...(schema.required ?? []), key]);\n }\n }\n\n if (!isEmpty(schema.properties)) {\n schema.type ??= 'object';\n delete schema.oneOf;\n delete schema.anyOf;\n normalizeSchemaObjects(spec, Object.values(schema.properties), visited);\n for (const [key, value] of Object.entries(schema.properties)) {\n if (\n notRef(value) &&\n isPrimitiveSchema(value) &&\n schema.default?.[key] !== undefined\n ) {\n value.default ??= schema.default[key];\n delete schema.default?.[key];\n }\n }\n delete schema.default;\n }\n\n if (!isEmpty(schema['x-properties'])) {\n normalizeSchemaObjects(\n spec,\n Object.values(schema['x-properties']),\n visited,\n );\n }\n\n if (!isEmpty(schema.items)) {\n delete schema.oneOf;\n delete schema.anyOf;\n schema.type = 'array';\n normalizeSchemaObjects(spec, [schema.items], visited);\n const items = resolveRef<SchemaObject>(spec, schema.items);\n if (Array.isArray(items.default)) {\n schema.default ??= structuredClone(items.default);\n }\n delete items.default;\n }\n\n if (!isEmpty(schema.anyOf) && !isEmpty(schema.oneOf)) {\n delete schema.anyOf;\n }\n\n if (isEmpty(schema.enum)) {\n delete schema.enum;\n }\n\n if (!isEmpty(schema.enum)) {\n if (schema.enum.length === 1) {\n schema.const = schema.enum[0];\n delete schema.enum;\n } else {\n const valuesSet = new Set<string>();\n const valuesList = [];\n for (const value of schema.enum) {\n const formattedValue = formatName(snakecase(formatName(value)));\n if (!valuesSet.has(formattedValue)) {\n valuesSet.add(formattedValue);\n valuesList.push(value);\n }\n }\n schema.enum = valuesList;\n }\n delete schema.allOf;\n }\n\n if (!isEmpty(schema.allOf)) {\n const schemas = schema.allOf;\n const resolved = schemas.map((item) =>\n resolveRef<SchemaObject>(spec, item),\n );\n const hasObjects = resolved.some((item) => item.type === 'object');\n const hasOtherTypes = resolved.some(\n (item) => item.type && item.type !== 'object',\n );\n if (hasObjects && hasOtherTypes) {\n assert(false, `allOf must be an object`);\n }\n mergeWith(\n schema,\n ...resolved.map((resolvedSchema, index) => {\n const sourceSchema = schemas[index];\n if (isRef(sourceSchema)) {\n if (visited.has(sourceSchema.$ref)) {\n throw new Error(\n `Circular allOf reference detected: ${[\n ...visited,\n sourceSchema.$ref,\n ].join(' -> ')}`,\n );\n }\n normalizeSchemaObjects(\n spec,\n [resolvedSchema],\n new Set(visited).add(sourceSchema.$ref),\n );\n } else {\n normalizeSchemaObjects(spec, [resolvedSchema], visited);\n }\n return resolvedSchema;\n }),\n unionRequired,\n );\n delete schema.allOf;\n } else {\n delete schema.allOf;\n }\n\n if (\n schema.type === 'object' &&\n isEmpty(schema.properties) &&\n typeof schema.additionalProperties === 'object' &&\n !isEmpty(schema.additionalProperties) &&\n notRef(schema.additionalProperties) &&\n !isEmpty(schema.additionalProperties.properties)\n ) {\n normalizeSchemaObjects(\n spec,\n Object.values(schema.additionalProperties.properties),\n visited,\n );\n }\n\n for (const kind of ['oneOf', 'anyOf'] as const) {\n if (!isEmpty(schema[kind])) {\n delete schema.type;\n normalizeSchemaObjects(spec, schema[kind], visited);\n if (isEmpty(schema[kind])) {\n continue;\n }\n\n let enumSchemaIndex = -1;\n const enumValues: string[] = [];\n for (let index = 0; index < schema[kind].length; index++) {\n const item = schema[kind][index];\n if (notRef(item) && item.type === 'string') {\n if (item.enum && item.enum.length > 1) {\n enumValues.push(...item.enum);\n if (enumSchemaIndex === -1) {\n enumSchemaIndex = index;\n }\n }\n }\n }\n if (enumSchemaIndex !== -1) {\n const enumSchema = schema[kind][enumSchemaIndex];\n if (notRef(enumSchema)) {\n enumSchema.enum = uniq(enumValues);\n }\n schema[kind] = schema[kind].filter(\n (item, index) => index === enumSchemaIndex || isRef(item),\n );\n }\n const otherTypes = schema[kind].filter(\n (item) => resolveRef<SchemaObject>(spec, item).type !== 'null',\n );\n const [only] = otherTypes;\n const droppedNull = otherTypes.length !== schema[kind].length;\n // A $ref cannot carry null, so a nullable $ref keeps its union.\n if (otherTypes.length === 1 && !(droppedNull && isRef(only))) {\n Object.assign(schema, only);\n delete schema[kind];\n if (droppedNull && notRef(only)) {\n const types = coerceTypes(only, false);\n if (types.length) {\n const typesWithNull: SchemaObjectType[] = [...types, 'null'];\n schema.type = uniq(typesWithNull);\n }\n }\n continue;\n }\n\n schema['x-varients'] = findVarients(spec, schema[kind]);\n } else {\n delete schema[kind];\n }\n }\n }\n}\n\n// allOf is a conjunction, so a value must carry every part's required\n// properties; lodash's default merge would overwrite the arrays by index.\nfunction unionRequired(target: unknown, source: unknown, key: string) {\n if (key === 'required' && Array.isArray(target) && Array.isArray(source)) {\n return uniq([...target, ...source]);\n }\n return undefined;\n}\n\nexport function normalizeSchemas(): IRPlugin {\n return {\n name: 'normalize-schemas',\n process({ spec }) {\n normalizeSchemaObjects(spec, Object.values(spec.components.schemas));\n },\n };\n}\n"],
5
+ "mappings": "AAAA,SAAS,WAAW,YAAY;AAChC,OAAO,YAAY;AAOnB,SAAS,SAAS,OAAO,QAAQ,YAAY,iBAAiB;AAE9D,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAClC,SAAS,mBAAmB;AAI5B,SAAS,uBACP,MACA,SACA,UAAU,oBAAI,IAAY,GAC1B;AACA,aAAW,UAAU,SAAS;AAC5B,QAAI,MAAM,MAAM,EAAG;AAKnB,QAAI,OAAO,aAAa,UAAa,CAAC,MAAM,QAAQ,OAAO,QAAQ,GAAG;AACpE,aAAO,OAAO;AAAA,IAChB;AACA,eAAW,CAAC,KAAK,QAAQ,KAAK,OAAO,QAAQ,OAAO,cAAc,CAAC,CAAC,GAAG;AAErE,YAAM,OAAgB,OAAO,QAAQ,IAAI,SAAS,WAAW;AAC7D,UAAI,SAAS,MAAM;AACjB,eAAO,WAAW,KAAK,CAAC,GAAI,OAAO,YAAY,CAAC,GAAI,GAAG,CAAC;AAAA,MAC1D;AAAA,IACF;AAEA,QAAI,CAAC,QAAQ,OAAO,UAAU,GAAG;AAC/B,aAAO,SAAS;AAChB,aAAO,OAAO;AACd,aAAO,OAAO;AACd,6BAAuB,MAAM,OAAO,OAAO,OAAO,UAAU,GAAG,OAAO;AACtE,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,OAAO,UAAU,GAAG;AAC5D,YACE,OAAO,KAAK,KACZ,kBAAkB,KAAK,KACvB,OAAO,UAAU,GAAG,MAAM,QAC1B;AACA,gBAAM,YAAY,OAAO,QAAQ,GAAG;AACpC,iBAAO,OAAO,UAAU,GAAG;AAAA,QAC7B;AAAA,MACF;AACA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AAO,KAAK,aAAa;AAAA,YAClC;AAAA,UACF;AACA;AAAA,QACF;AAEA,eAAO,YAAY,IAAI,aAAa,MAAM,OAAO,IAAI,CAAC;AAAA,MACxD,OAAO;AACL,eAAO,OAAO,IAAI;AAAA,MACpB;AAAA,IACF;AAAA,EACF;AACF;AAIA,SAAS,cAAc,QAAiB,QAAiB,KAAa;AACpE,MAAI,QAAQ,cAAc,MAAM,QAAQ,MAAM,KAAK,MAAM,QAAQ,MAAM,GAAG;AACxE,WAAO,KAAK,CAAC,GAAG,QAAQ,GAAG,MAAM,CAAC;AAAA,EACpC;AACA,SAAO;AACT;AAEO,SAAS,mBAA6B;AAC3C,SAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,EAAE,KAAK,GAAG;AAChB,6BAAuB,MAAM,OAAO,OAAO,KAAK,WAAW,OAAO,CAAC;AAAA,IACrE;AAAA,EACF;AACF;",
6
6
  "names": ["schemas"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdk-it/spec",
3
- "version": "0.47.4",
3
+ "version": "0.48.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/JanuaryLabs/sdk-it",
@@ -36,7 +36,7 @@
36
36
  "!**/*.test.*"
37
37
  ],
38
38
  "dependencies": {
39
- "@sdk-it/core": "0.47.4",
39
+ "@sdk-it/core": "0.48.1",
40
40
  "@zukhruf/async": "^0.8.33",
41
41
  "@zukhruf/fs": "^0.8.33",
42
42
  "lodash-es": "^4.17.21",