@hey-api/shared 0.1.2 → 0.2.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.
package/dist/index.mjs CHANGED
@@ -5,6 +5,7 @@ import ts from "typescript";
5
5
  import { sync } from "cross-spawn";
6
6
  import * as semver from "semver";
7
7
  import { getResolvedInput, sendRequest } from "@hey-api/json-schema-ref-parser";
8
+ import { fromRef, ref } from "@hey-api/codegen-core";
8
9
  import { EOL } from "node:os";
9
10
 
10
11
  //#region src/tsConfig.ts
@@ -709,7 +710,8 @@ function getParser(userConfig) {
709
710
  case: "preserve",
710
711
  name: "{{name}}"
711
712
  }
712
- }
713
+ },
714
+ schemaName: void 0
713
715
  },
714
716
  validate_EXPERIMENTAL: false
715
717
  },
@@ -763,7 +765,8 @@ function getParser(userConfig) {
763
765
  })
764
766
  },
765
767
  value: fields$1.readWrite
766
- })
768
+ }),
769
+ schemaName: fields$1.schemaName !== void 0 ? fields$1.schemaName : defaultValue$1.schemaName
767
770
  }) },
768
771
  value: fields.transforms
769
772
  }),
@@ -1384,9 +1387,10 @@ async function getSpec({ fetchOptions, inputPath, timeout, watch }) {
1384
1387
  };
1385
1388
  response = request.response;
1386
1389
  } catch (error) {
1390
+ const message = error instanceof Error ? error.message : String(error);
1387
1391
  return {
1388
1392
  error: "not-ok",
1389
- response: new Response(error instanceof Error ? error.message : String(error))
1393
+ response: new Response(message, { status: 500 })
1390
1394
  };
1391
1395
  }
1392
1396
  if (!response.ok && watch.isHeadMethodSupported) return {
@@ -1432,9 +1436,10 @@ async function getSpec({ fetchOptions, inputPath, timeout, watch }) {
1432
1436
  };
1433
1437
  response = request.response;
1434
1438
  } catch (error) {
1439
+ const message = error instanceof Error ? error.message : String(error);
1435
1440
  return {
1436
1441
  error: "not-ok",
1437
- response: new Response(error instanceof Error ? error.message : String(error))
1442
+ response: new Response(message, { status: 500 })
1438
1443
  };
1439
1444
  }
1440
1445
  if (!response.ok) return {
@@ -1782,7 +1787,7 @@ function pathToJsonPointer(path$1) {
1782
1787
  return "#" + (segments ? `/${segments}` : "");
1783
1788
  }
1784
1789
  /**
1785
- * Checks if a $ref points to a top-level component (not a deep path reference).
1790
+ * Checks if a $ref or path points to a top-level component (not a deep path reference).
1786
1791
  *
1787
1792
  * Top-level component references:
1788
1793
  * - OpenAPI 3.x: #/components/{type}/{name} (3 segments)
@@ -1791,11 +1796,11 @@ function pathToJsonPointer(path$1) {
1791
1796
  * Deep path references (4+ segments for 3.x, 3+ for 2.0) should be inlined
1792
1797
  * because they don't have corresponding registered symbols.
1793
1798
  *
1794
- * @param $ref - The $ref string to check
1799
+ * @param refOrPath - The $ref string or path array to check
1795
1800
  * @returns true if the ref points to a top-level component, false otherwise
1796
1801
  */
1797
- function isTopLevelComponentRef($ref) {
1798
- const path$1 = jsonPointerToPath($ref);
1802
+ function isTopLevelComponent(refOrPath) {
1803
+ const path$1 = refOrPath instanceof Array ? refOrPath : jsonPointerToPath(refOrPath);
1799
1804
  if (path$1[0] === "components") return path$1.length === 3;
1800
1805
  if (path$1[0] === "definitions") return path$1.length === 2;
1801
1806
  return false;
@@ -2272,6 +2277,112 @@ var IntentContext = class {
2272
2277
  }
2273
2278
  };
2274
2279
 
2280
+ //#endregion
2281
+ //#region src/ir/schema-processor.ts
2282
+ function createSchemaProcessor() {
2283
+ const emitted = /* @__PURE__ */ new Set();
2284
+ let contextTags;
2285
+ let contextAnchor;
2286
+ return {
2287
+ get context() {
2288
+ return {
2289
+ anchor: contextAnchor,
2290
+ tags: contextTags
2291
+ };
2292
+ },
2293
+ hasEmitted(path$1) {
2294
+ return emitted.has(pathToJsonPointer(path$1));
2295
+ },
2296
+ markEmitted(path$1) {
2297
+ const pointer = pathToJsonPointer(path$1);
2298
+ if (emitted.has(pointer)) return false;
2299
+ emitted.add(pointer);
2300
+ return true;
2301
+ },
2302
+ withContext(ctx, fn) {
2303
+ const prevTags = contextTags;
2304
+ const prevAnchor = contextAnchor;
2305
+ contextTags = ctx.tags;
2306
+ contextAnchor = ctx.anchor;
2307
+ try {
2308
+ return fn();
2309
+ } finally {
2310
+ contextTags = prevTags;
2311
+ contextAnchor = prevAnchor;
2312
+ }
2313
+ }
2314
+ };
2315
+ }
2316
+
2317
+ //#endregion
2318
+ //#region src/ir/schema-walker.ts
2319
+ /**
2320
+ * Create a schema walker from a visitor.
2321
+ *
2322
+ * The walker handles:
2323
+ * - Dispatch order ($ref → type → items → fallback)
2324
+ * - Deduplication of union/intersection schemas
2325
+ * - Path tracking for child schemas
2326
+ */
2327
+ function createSchemaWalker(visitor) {
2328
+ const walk$1 = (schema, ctx) => {
2329
+ if (visitor.intercept) {
2330
+ const intercepted = visitor.intercept(schema, ctx, walk$1);
2331
+ if (intercepted !== void 0) return intercepted;
2332
+ }
2333
+ if (schema.$ref) return visitor.reference(schema.$ref, schema, ctx);
2334
+ if (schema.type) {
2335
+ let result = visitTyped(schema, ctx, visitor, walk$1);
2336
+ if (visitor.postProcess) result = visitor.postProcess(result, schema, ctx);
2337
+ return result;
2338
+ }
2339
+ if (schema.items) {
2340
+ const deduplicated = deduplicateSchema({ schema });
2341
+ if (!deduplicated.items) return walk$1(deduplicated, ctx);
2342
+ const itemResults = deduplicated.items.map((item, index) => walk$1(item, {
2343
+ ...ctx,
2344
+ path: ref([
2345
+ ...fromRef(ctx.path),
2346
+ "items",
2347
+ index
2348
+ ])
2349
+ }));
2350
+ return deduplicated.logicalOperator === "and" ? visitor.intersection(itemResults, deduplicated.items, schema, ctx) : visitor.union(itemResults, deduplicated.items, schema, ctx);
2351
+ }
2352
+ return visitor.unknown({ type: "unknown" }, ctx);
2353
+ };
2354
+ return walk$1;
2355
+ }
2356
+ /**
2357
+ * Dispatch to the appropriate visitor method based on schema type.
2358
+ */
2359
+ function visitTyped(schema, ctx, visitor, walk$1) {
2360
+ switch (schema.type) {
2361
+ case "array": return visitor.array(schema, ctx, walk$1);
2362
+ case "boolean": return visitor.boolean(schema, ctx);
2363
+ case "enum": return visitor.enum(schema, ctx, walk$1);
2364
+ case "integer": return visitor.integer(schema, ctx);
2365
+ case "never": return visitor.never(schema, ctx);
2366
+ case "null": return visitor.null(schema, ctx);
2367
+ case "number": return visitor.number(schema, ctx);
2368
+ case "object": return visitor.object(schema, ctx, walk$1);
2369
+ case "string": return visitor.string(schema, ctx);
2370
+ case "tuple": return visitor.tuple(schema, ctx, walk$1);
2371
+ case "undefined": return visitor.undefined(schema, ctx);
2372
+ case "unknown": return visitor.unknown(schema, ctx);
2373
+ case "void": return visitor.void(schema, ctx);
2374
+ }
2375
+ }
2376
+ /**
2377
+ * Helper to create a child context with an extended path.
2378
+ */
2379
+ function childContext(ctx, ...segments) {
2380
+ return {
2381
+ ...ctx,
2382
+ path: ref([...fromRef(ctx.path), ...segments])
2383
+ };
2384
+ }
2385
+
2275
2386
  //#endregion
2276
2387
  //#region src/openApi/shared/utils/filter.ts
2277
2388
  const namespaceNeedle = "/";
@@ -2841,7 +2952,8 @@ const childSchemaRelationships = [
2841
2952
  ["patternProperties", "objectMap"],
2842
2953
  ["properties", "objectMap"],
2843
2954
  ["propertyNames", "single"],
2844
- ["then", "single"]
2955
+ ["then", "single"],
2956
+ ["unevaluatedProperties", "single"]
2845
2957
  ];
2846
2958
 
2847
2959
  //#endregion
@@ -3444,7 +3556,8 @@ const schemaKeys = new Set([
3444
3556
  "oneOf",
3445
3557
  "patternProperties",
3446
3558
  "properties",
3447
- "schema"
3559
+ "schema",
3560
+ "unevaluatedProperties"
3448
3561
  ]);
3449
3562
  const getComponentContext = (path$1) => {
3450
3563
  if (path$1.length === 3 && path$1[0] === "components") {
@@ -3961,11 +4074,56 @@ const readWriteTransform = ({ config, logger, spec }) => {
3961
4074
  });
3962
4075
  };
3963
4076
 
4077
+ //#endregion
4078
+ //#region src/openApi/shared/transforms/schemas.ts
4079
+ /**
4080
+ * Recursively walks the entire spec object and replaces all $ref strings
4081
+ * according to the provided rename mapping.
4082
+ */
4083
+ const rewriteRefs = (node, renameMap) => {
4084
+ if (node instanceof Array) node.forEach((item) => rewriteRefs(item, renameMap));
4085
+ else if (node && typeof node === "object") for (const [key, value] of Object.entries(node)) if (key === "$ref" && typeof value === "string" && value in renameMap) node[key] = renameMap[value];
4086
+ else rewriteRefs(value, renameMap);
4087
+ };
4088
+ /**
4089
+ * Renames schema component keys and updates all $ref pointers throughout
4090
+ * the spec. Handles collisions by skipping renames when the target name
4091
+ * already exists or conflicts with another rename.
4092
+ */
4093
+ const schemaNameTransform = ({ config, spec }) => {
4094
+ if (!config) return;
4095
+ const schemasObj = getSchemasObject(spec);
4096
+ if (!schemasObj) return;
4097
+ const schemasPointerNamespace = specToSchemasPointerNamespace(spec);
4098
+ if (!schemasPointerNamespace) return;
4099
+ const renameMap = {};
4100
+ const newNames = /* @__PURE__ */ new Set();
4101
+ const namingConfig = { name: config };
4102
+ for (const oldName of Object.keys(schemasObj)) {
4103
+ const newName = applyNaming(oldName, namingConfig);
4104
+ if (newName === oldName || newName in schemasObj || newNames.has(newName)) continue;
4105
+ renameMap[`${schemasPointerNamespace}${oldName}`] = `${schemasPointerNamespace}${newName}`;
4106
+ newNames.add(newName);
4107
+ }
4108
+ for (const [oldPointer, newPointer] of Object.entries(renameMap)) {
4109
+ const oldName = oldPointer.slice(schemasPointerNamespace.length);
4110
+ const newName = newPointer.slice(schemasPointerNamespace.length);
4111
+ const schema = schemasObj[oldName];
4112
+ delete schemasObj[oldName];
4113
+ schemasObj[newName] = schema;
4114
+ }
4115
+ if (Object.keys(renameMap).length > 0) rewriteRefs(spec, renameMap);
4116
+ };
4117
+
3964
4118
  //#endregion
3965
4119
  //#region src/openApi/shared/transforms/index.ts
3966
4120
  const transformOpenApiSpec = ({ context }) => {
3967
4121
  const { logger } = context;
3968
4122
  const eventTransformOpenApiSpec = logger.timeEvent("transform-openapi-spec");
4123
+ if (context.config.parser.transforms.schemaName) schemaNameTransform({
4124
+ config: context.config.parser.transforms.schemaName,
4125
+ spec: context.spec
4126
+ });
3969
4127
  if (context.config.parser.transforms.enums.enabled) enumsTransform({
3970
4128
  config: context.config.parser.transforms.enums,
3971
4129
  spec: context.spec
@@ -4132,6 +4290,64 @@ function getPaginationKeywordsRegExp(pagination) {
4132
4290
 
4133
4291
  //#endregion
4134
4292
  //#region src/openApi/shared/utils/discriminator.ts
4293
+ /**
4294
+ * Converts a string discriminator mapping value to the appropriate type based on
4295
+ * the actual property type in the schema.
4296
+ *
4297
+ * OpenAPI discriminator mappings always use string keys, but the actual discriminator
4298
+ * property may be a boolean, number, or integer. This function converts the string
4299
+ * key to the correct runtime value and IR type.
4300
+ */
4301
+ const convertDiscriminatorValue = (value, propertyType) => {
4302
+ switch (propertyType) {
4303
+ case "boolean": {
4304
+ const lowerValue = value.toLowerCase();
4305
+ if (lowerValue !== "true" && lowerValue !== "false") {
4306
+ console.warn("🚨", `non-boolean discriminator mapping value "${value}" for boolean property, falling back to string`);
4307
+ return {
4308
+ const: value,
4309
+ type: "string"
4310
+ };
4311
+ }
4312
+ return {
4313
+ const: lowerValue === "true",
4314
+ type: "boolean"
4315
+ };
4316
+ }
4317
+ case "integer": {
4318
+ const parsed = parseInt(value, 10);
4319
+ if (Number.isNaN(parsed)) {
4320
+ console.warn("🚨", `non-numeric discriminator mapping value "${value}" for integer property, falling back to string`);
4321
+ return {
4322
+ const: value,
4323
+ type: "string"
4324
+ };
4325
+ }
4326
+ return {
4327
+ const: parsed,
4328
+ type: "integer"
4329
+ };
4330
+ }
4331
+ case "number": {
4332
+ const parsed = parseFloat(value);
4333
+ if (Number.isNaN(parsed)) {
4334
+ console.warn("🚨", `non-numeric discriminator mapping value "${value}" for number property, falling back to string`);
4335
+ return {
4336
+ const: value,
4337
+ type: "string"
4338
+ };
4339
+ }
4340
+ return {
4341
+ const: parsed,
4342
+ type: "number"
4343
+ };
4344
+ }
4345
+ default: return {
4346
+ const: value,
4347
+ type: "string"
4348
+ };
4349
+ }
4350
+ };
4135
4351
  const discriminatorValues = ($ref, mapping, shouldUseRefAsValue) => {
4136
4352
  const values = [];
4137
4353
  for (const name in mapping) if (mapping[name] === $ref) values.push(name);
@@ -4263,20 +4479,20 @@ const parseAllOf$2 = ({ context, schema, state }) => {
4263
4479
  else irCompositionSchema.required = schema.required;
4264
4480
  schemaItems.push(irCompositionSchema);
4265
4481
  if (compositionSchema.$ref) {
4266
- const ref = context.resolveRef(compositionSchema.$ref);
4267
- if (ref.discriminator && state.$ref) {
4482
+ const ref$1 = context.resolveRef(compositionSchema.$ref);
4483
+ if (ref$1.discriminator && state.$ref) {
4268
4484
  const valueSchemas = discriminatorValues(state.$ref).map((value) => ({
4269
4485
  const: value,
4270
4486
  type: "string"
4271
4487
  }));
4272
4488
  const irDiscriminatorSchema = {
4273
- properties: { [ref.discriminator]: valueSchemas.length > 1 ? {
4489
+ properties: { [ref$1.discriminator]: valueSchemas.length > 1 ? {
4274
4490
  items: valueSchemas,
4275
4491
  logicalOperator: "or"
4276
4492
  } : valueSchemas[0] },
4277
4493
  type: "object"
4278
4494
  };
4279
- if (ref.required?.includes(ref.discriminator)) irDiscriminatorSchema.required = [ref.discriminator];
4495
+ if (ref$1.required?.includes(ref$1.discriminator)) irDiscriminatorSchema.required = [ref$1.discriminator];
4280
4496
  schemaItems.push(irDiscriminatorSchema);
4281
4497
  }
4282
4498
  }
@@ -4364,7 +4580,7 @@ const parseEnum$2 = ({ context, schema, state }) => {
4364
4580
  };
4365
4581
  const parseRef$2 = ({ context, schema, state }) => {
4366
4582
  const irSchema = {};
4367
- if (!isTopLevelComponentRef(schema.$ref)) {
4583
+ if (!isTopLevelComponent(schema.$ref)) {
4368
4584
  if (!state.circularReferenceTracker.has(schema.$ref)) {
4369
4585
  const refSchema = context.resolveRef(schema.$ref);
4370
4586
  const originalRef = state.$ref;
@@ -4542,19 +4758,19 @@ const isPaginationType$2 = (schemaType) => schemaType === "boolean" || schemaTyp
4542
4758
  const paginationField$2 = ({ context, name, schema }) => {
4543
4759
  if (getPaginationKeywordsRegExp(context.config.parser.pagination).test(name)) return true;
4544
4760
  if ("$ref" in schema) {
4545
- const ref = context.resolveRef(schema.$ref ?? "");
4546
- if ("in" in ref && ref.in) return paginationField$2({
4761
+ const ref$1 = context.resolveRef(schema.$ref ?? "");
4762
+ if ("in" in ref$1 && ref$1.in) return paginationField$2({
4547
4763
  context,
4548
4764
  name,
4549
- schema: "schema" in ref ? ref.schema : {
4550
- ...ref,
4765
+ schema: "schema" in ref$1 ? ref$1.schema : {
4766
+ ...ref$1,
4551
4767
  in: void 0
4552
4768
  }
4553
4769
  });
4554
4770
  return paginationField$2({
4555
4771
  context,
4556
4772
  name,
4557
- schema: ref
4773
+ schema: ref$1
4558
4774
  });
4559
4775
  }
4560
4776
  if ("in" in schema) {
@@ -5275,6 +5491,29 @@ const getSchemaType = ({ schema }) => {
5275
5491
  if (schema.properties) return "object";
5276
5492
  };
5277
5493
  /**
5494
+ * Finds the type of a discriminator property by looking it up in the provided schemas.
5495
+ * Searches through properties and allOf chains to find the property definition.
5496
+ */
5497
+ const findDiscriminatorPropertyType$1 = ({ context, propertyName, schemas }) => {
5498
+ for (const schema of schemas) {
5499
+ const resolved = "$ref" in schema ? context.resolveRef(schema.$ref) : schema;
5500
+ const property = resolved.properties?.[propertyName];
5501
+ if (property) {
5502
+ const resolvedProperty = "$ref" in property ? context.resolveRef(property.$ref) : property;
5503
+ if (resolvedProperty.type === "boolean" || resolvedProperty.type === "integer" || resolvedProperty.type === "number") return resolvedProperty.type;
5504
+ }
5505
+ if (resolved.allOf) {
5506
+ const foundType = findDiscriminatorPropertyType$1({
5507
+ context,
5508
+ propertyName,
5509
+ schemas: resolved.allOf
5510
+ });
5511
+ if (foundType !== "string") return foundType;
5512
+ }
5513
+ }
5514
+ return "string";
5515
+ };
5516
+ /**
5278
5517
  * Recursively finds discriminators in a schema, including nested allOf compositions.
5279
5518
  * This is needed when a schema extends another schema via allOf, and that parent
5280
5519
  * schema is itself an allOf composition with discriminators in inline schemas.
@@ -5427,17 +5666,17 @@ const parseAllOf$1 = ({ context, schema, state }) => {
5427
5666
  else irCompositionSchema.required = schema.required;
5428
5667
  schemaItems.push(irCompositionSchema);
5429
5668
  if ("$ref" in compositionSchema) {
5430
- const ref = context.resolveRef(compositionSchema.$ref);
5669
+ const ref$1 = context.resolveRef(compositionSchema.$ref);
5431
5670
  if (state.$ref) {
5432
5671
  const discriminators = findDiscriminatorsInSchema$1({
5433
5672
  context,
5434
- schema: ref
5673
+ schema: ref$1
5435
5674
  });
5436
5675
  for (const { discriminator, oneOf } of discriminators) {
5437
5676
  if (addedDiscriminators.has(discriminator.propertyName)) continue;
5438
5677
  const values = discriminatorValues(state.$ref, discriminator.mapping, oneOf ? () => oneOf.some((o) => "$ref" in o && o.$ref === state.$ref) : void 0);
5439
5678
  if (values.length > 0) {
5440
- const isRequired = discriminators.some((d) => d.discriminator.propertyName === discriminator.propertyName && (ref.required?.includes(d.discriminator.propertyName) || ref.allOf && ref.allOf.some((item) => {
5679
+ const isRequired = discriminators.some((d) => d.discriminator.propertyName === discriminator.propertyName && (ref$1.required?.includes(d.discriminator.propertyName) || ref$1.allOf && ref$1.allOf.some((item) => {
5441
5680
  return ("$ref" in item ? context.resolveRef(item.$ref) : item).required?.includes(d.discriminator.propertyName);
5442
5681
  })));
5443
5682
  discriminatorsToAdd.push({
@@ -5456,10 +5695,13 @@ const parseAllOf$1 = ({ context, schema, state }) => {
5456
5695
  discriminator,
5457
5696
  schemaRef: state.$ref
5458
5697
  });
5459
- const valueSchemas = (allValues.length > 0 ? allValues : values).map((value) => ({
5460
- const: value,
5461
- type: "string"
5462
- }));
5698
+ const finalValues = allValues.length > 0 ? allValues : values;
5699
+ const propertyType = findDiscriminatorPropertyType$1({
5700
+ context,
5701
+ propertyName: discriminator.propertyName,
5702
+ schemas: compositionSchemas
5703
+ });
5704
+ const valueSchemas = finalValues.map((value) => convertDiscriminatorValue(value, propertyType));
5463
5705
  const discriminatorProperty = valueSchemas.length > 1 ? {
5464
5706
  items: valueSchemas,
5465
5707
  logicalOperator: "or"
@@ -5557,6 +5799,11 @@ const parseAnyOf$1 = ({ context, schema, state }) => {
5557
5799
  const schemaItems = [];
5558
5800
  const schemaType = getSchemaType({ schema });
5559
5801
  const compositionSchemas = schema.anyOf;
5802
+ const discriminatorPropertyType = schema.discriminator ? findDiscriminatorPropertyType$1({
5803
+ context,
5804
+ propertyName: schema.discriminator.propertyName,
5805
+ schemas: compositionSchemas
5806
+ }) : void 0;
5560
5807
  for (const compositionSchema of compositionSchemas) {
5561
5808
  let irCompositionSchema = schemaToIrSchema$1({
5562
5809
  context,
@@ -5564,10 +5811,7 @@ const parseAnyOf$1 = ({ context, schema, state }) => {
5564
5811
  state
5565
5812
  });
5566
5813
  if (schema.discriminator && irCompositionSchema.$ref != null) {
5567
- const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => ({
5568
- const: value,
5569
- type: "string"
5570
- }));
5814
+ const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => convertDiscriminatorValue(value, discriminatorPropertyType));
5571
5815
  irCompositionSchema = {
5572
5816
  items: [{
5573
5817
  properties: { [schema.discriminator.propertyName]: valueSchemas.length > 1 ? {
@@ -5641,6 +5885,11 @@ const parseOneOf$1 = ({ context, schema, state }) => {
5641
5885
  let schemaItems = [];
5642
5886
  const schemaType = getSchemaType({ schema });
5643
5887
  const compositionSchemas = schema.oneOf;
5888
+ const discriminatorPropertyType = schema.discriminator ? findDiscriminatorPropertyType$1({
5889
+ context,
5890
+ propertyName: schema.discriminator.propertyName,
5891
+ schemas: compositionSchemas
5892
+ }) : void 0;
5644
5893
  for (const compositionSchema of compositionSchemas) {
5645
5894
  let irCompositionSchema = schemaToIrSchema$1({
5646
5895
  context,
@@ -5648,10 +5897,7 @@ const parseOneOf$1 = ({ context, schema, state }) => {
5648
5897
  state
5649
5898
  });
5650
5899
  if (schema.discriminator && irCompositionSchema.$ref != null) {
5651
- const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => ({
5652
- const: value,
5653
- type: "string"
5654
- }));
5900
+ const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => convertDiscriminatorValue(value, discriminatorPropertyType));
5655
5901
  irCompositionSchema = {
5656
5902
  items: [{
5657
5903
  properties: { [schema.discriminator.propertyName]: valueSchemas.length > 1 ? {
@@ -5690,7 +5936,7 @@ const parseOneOf$1 = ({ context, schema, state }) => {
5690
5936
  return irSchema;
5691
5937
  };
5692
5938
  const parseRef$1 = ({ context, schema, state }) => {
5693
- if (!isTopLevelComponentRef(schema.$ref)) {
5939
+ if (!isTopLevelComponent(schema.$ref)) {
5694
5940
  if (!state.circularReferenceTracker.has(schema.$ref)) {
5695
5941
  const refSchema = context.resolveRef(schema.$ref);
5696
5942
  const originalRef = state.$ref;
@@ -5878,12 +6124,12 @@ const isPaginationType$1 = (schemaType) => schemaType === "boolean" || schemaTyp
5878
6124
  const paginationField$1 = ({ context, name, schema }) => {
5879
6125
  if (getPaginationKeywordsRegExp(context.config.parser.pagination).test(name)) return true;
5880
6126
  if ("$ref" in schema) {
5881
- const ref = context.resolveRef(schema.$ref);
5882
- if ("content" in ref || "in" in ref) {
6127
+ const ref$1 = context.resolveRef(schema.$ref);
6128
+ if ("content" in ref$1 || "in" in ref$1) {
5883
6129
  let refSchema;
5884
- if ("in" in ref) refSchema = ref.schema;
6130
+ if ("in" in ref$1) refSchema = ref$1.schema;
5885
6131
  if (!refSchema) {
5886
- const contents = mediaTypeObjects$1({ content: ref.content });
6132
+ const contents = mediaTypeObjects$1({ content: ref$1.content });
5887
6133
  const content = contents.find((content$1) => content$1.type === "json") || contents[0];
5888
6134
  if (content?.schema) refSchema = content.schema;
5889
6135
  }
@@ -5897,7 +6143,7 @@ const paginationField$1 = ({ context, name, schema }) => {
5897
6143
  return paginationField$1({
5898
6144
  context,
5899
6145
  name,
5900
- schema: ref
6146
+ schema: ref$1
5901
6147
  });
5902
6148
  }
5903
6149
  for (const name$1 in schema.properties) if (getPaginationKeywordsRegExp(context.config.parser.pagination).test(name$1)) {
@@ -6572,6 +6818,31 @@ const getSchemaTypes = ({ schema }) => {
6572
6818
  return [];
6573
6819
  };
6574
6820
  /**
6821
+ * Finds the type of a discriminator property by looking it up in the provided schemas.
6822
+ * Searches through properties and allOf chains to find the property definition.
6823
+ */
6824
+ const findDiscriminatorPropertyType = ({ context, propertyName, schemas }) => {
6825
+ for (const schema of schemas) {
6826
+ const resolved = schema.$ref ? context.resolveRef(schema.$ref) : schema;
6827
+ const property = resolved.properties?.[propertyName];
6828
+ if (property === true) continue;
6829
+ if (property) {
6830
+ const resolvedProperty = property.$ref ? context.resolveRef(property.$ref) : property;
6831
+ const propertyTypes = Array.isArray(resolvedProperty.type) ? resolvedProperty.type : resolvedProperty.type ? [resolvedProperty.type] : [];
6832
+ for (const propType of propertyTypes) if (propType === "boolean" || propType === "integer" || propType === "number") return propType;
6833
+ }
6834
+ if (resolved.allOf) {
6835
+ const foundType = findDiscriminatorPropertyType({
6836
+ context,
6837
+ propertyName,
6838
+ schemas: resolved.allOf
6839
+ });
6840
+ if (foundType !== "string") return foundType;
6841
+ }
6842
+ }
6843
+ return "string";
6844
+ };
6845
+ /**
6575
6846
  * Recursively finds discriminators in a schema, including nested allOf compositions.
6576
6847
  * This is needed when a schema extends another schema via allOf, and that parent
6577
6848
  * schema is itself an allOf composition with discriminators in inline schemas.
@@ -6629,6 +6900,7 @@ const parseSchemaMeta = ({ irSchema, schema }) => {
6629
6900
  if (schema.exclusiveMaximum !== void 0) irSchema.exclusiveMaximum = schema.exclusiveMaximum;
6630
6901
  if (schema.exclusiveMinimum !== void 0) irSchema.exclusiveMinimum = schema.exclusiveMinimum;
6631
6902
  if (schema.format) irSchema.format = schema.format;
6903
+ else if (schema.contentMediaType && isMediaTypeFileLike({ mediaType: schema.contentMediaType })) irSchema.format = "binary";
6632
6904
  if (schema.maximum !== void 0) irSchema.maximum = schema.maximum;
6633
6905
  if (schema.maxItems !== void 0) irSchema.maxItems = schema.maxItems;
6634
6906
  if (schema.maxLength !== void 0) irSchema.maxLength = schema.maxLength;
@@ -6770,17 +7042,17 @@ const parseAllOf = ({ context, schema, state }) => {
6770
7042
  else irCompositionSchema.required = schema.required;
6771
7043
  schemaItems.push(irCompositionSchema);
6772
7044
  if (compositionSchema.$ref) {
6773
- const ref = context.resolveRef(compositionSchema.$ref);
7045
+ const ref$1 = context.resolveRef(compositionSchema.$ref);
6774
7046
  if (state.$ref) {
6775
7047
  const discriminators = findDiscriminatorsInSchema({
6776
7048
  context,
6777
- schema: ref
7049
+ schema: ref$1
6778
7050
  });
6779
7051
  for (const { discriminator, oneOf } of discriminators) {
6780
7052
  if (addedDiscriminators.has(discriminator.propertyName)) continue;
6781
7053
  const values = discriminatorValues(state.$ref, discriminator.mapping, oneOf ? () => oneOf.some((o) => "$ref" in o && o.$ref === state.$ref) : void 0);
6782
7054
  if (values.length > 0) {
6783
- const isRequired = discriminators.some((d) => d.discriminator.propertyName === discriminator.propertyName && (ref.required?.includes(d.discriminator.propertyName) || ref.allOf && ref.allOf.some((item) => {
7055
+ const isRequired = discriminators.some((d) => d.discriminator.propertyName === discriminator.propertyName && (ref$1.required?.includes(d.discriminator.propertyName) || ref$1.allOf && ref$1.allOf.some((item) => {
6784
7056
  return (item.$ref ? context.resolveRef(item.$ref) : item).required?.includes(d.discriminator.propertyName);
6785
7057
  })));
6786
7058
  discriminatorsToAdd.push({
@@ -6799,10 +7071,13 @@ const parseAllOf = ({ context, schema, state }) => {
6799
7071
  discriminator,
6800
7072
  schemaRef: state.$ref
6801
7073
  });
6802
- const valueSchemas = (allValues.length > 0 ? allValues : values).map((value) => ({
6803
- const: value,
6804
- type: "string"
6805
- }));
7074
+ const finalValues = allValues.length > 0 ? allValues : values;
7075
+ const propertyType = findDiscriminatorPropertyType({
7076
+ context,
7077
+ propertyName: discriminator.propertyName,
7078
+ schemas: compositionSchemas
7079
+ });
7080
+ const valueSchemas = finalValues.map((value) => convertDiscriminatorValue(value, propertyType));
6806
7081
  const discriminatorProperty = valueSchemas.length > 1 ? {
6807
7082
  items: valueSchemas,
6808
7083
  logicalOperator: "or"
@@ -6902,6 +7177,11 @@ const parseAnyOf = ({ context, schema, state }) => {
6902
7177
  const schemaItems = [];
6903
7178
  const schemaTypes = getSchemaTypes({ schema });
6904
7179
  const compositionSchemas = schema.anyOf;
7180
+ const discriminatorPropertyType = schema.discriminator ? findDiscriminatorPropertyType({
7181
+ context,
7182
+ propertyName: schema.discriminator.propertyName,
7183
+ schemas: compositionSchemas
7184
+ }) : void 0;
6905
7185
  for (const compositionSchema of compositionSchemas) {
6906
7186
  let irCompositionSchema = schemaToIrSchema({
6907
7187
  context,
@@ -6909,10 +7189,7 @@ const parseAnyOf = ({ context, schema, state }) => {
6909
7189
  state
6910
7190
  });
6911
7191
  if (schema.discriminator && irCompositionSchema.$ref != null) {
6912
- const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => ({
6913
- const: value,
6914
- type: "string"
6915
- }));
7192
+ const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => convertDiscriminatorValue(value, discriminatorPropertyType));
6916
7193
  irCompositionSchema = {
6917
7194
  items: [{
6918
7195
  properties: { [schema.discriminator.propertyName]: valueSchemas.length > 1 ? {
@@ -6989,6 +7266,11 @@ const parseOneOf = ({ context, schema, state }) => {
6989
7266
  let schemaItems = [];
6990
7267
  const schemaTypes = getSchemaTypes({ schema });
6991
7268
  const compositionSchemas = schema.oneOf;
7269
+ const discriminatorPropertyType = schema.discriminator ? findDiscriminatorPropertyType({
7270
+ context,
7271
+ propertyName: schema.discriminator.propertyName,
7272
+ schemas: compositionSchemas
7273
+ }) : void 0;
6992
7274
  for (const compositionSchema of compositionSchemas) {
6993
7275
  let irCompositionSchema = schemaToIrSchema({
6994
7276
  context,
@@ -6996,10 +7278,7 @@ const parseOneOf = ({ context, schema, state }) => {
6996
7278
  state
6997
7279
  });
6998
7280
  if (schema.discriminator && irCompositionSchema.$ref != null) {
6999
- const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => ({
7000
- const: value,
7001
- type: "string"
7002
- }));
7281
+ const valueSchemas = discriminatorValues(irCompositionSchema.$ref, schema.discriminator.mapping).map((value) => convertDiscriminatorValue(value, discriminatorPropertyType));
7003
7282
  irCompositionSchema = {
7004
7283
  items: [{
7005
7284
  properties: { [schema.discriminator.propertyName]: valueSchemas.length > 1 ? {
@@ -7038,7 +7317,7 @@ const parseOneOf = ({ context, schema, state }) => {
7038
7317
  return irSchema;
7039
7318
  };
7040
7319
  const parseRef = ({ context, schema, state }) => {
7041
- if (!isTopLevelComponentRef(schema.$ref)) {
7320
+ if (!isTopLevelComponent(schema.$ref)) {
7042
7321
  if (!state.circularReferenceTracker.has(schema.$ref)) {
7043
7322
  const refSchema = context.resolveRef(schema.$ref);
7044
7323
  const originalRef = state.$ref;
@@ -7227,6 +7506,14 @@ const schemaToIrSchema = ({ context, schema, state }) => {
7227
7506
  schema,
7228
7507
  state
7229
7508
  });
7509
+ if (schema.contentMediaType && isMediaTypeFileLike({ mediaType: schema.contentMediaType })) return parseType({
7510
+ context,
7511
+ schema: {
7512
+ ...schema,
7513
+ type: "string"
7514
+ },
7515
+ state
7516
+ });
7230
7517
  return parseUnknown({
7231
7518
  context,
7232
7519
  schema
@@ -7251,12 +7538,12 @@ const isPaginationType = (schemaTypes) => schemaTypes.includes("boolean") || sch
7251
7538
  const paginationField = ({ context, name, schema }) => {
7252
7539
  if (getPaginationKeywordsRegExp(context.config.parser.pagination).test(name)) return true;
7253
7540
  if (schema.$ref) {
7254
- const ref = context.resolveRef(schema.$ref);
7255
- if ("content" in ref || "in" in ref) {
7541
+ const ref$1 = context.resolveRef(schema.$ref);
7542
+ if ("content" in ref$1 || "in" in ref$1) {
7256
7543
  let refSchema;
7257
- if ("in" in ref) refSchema = ref.schema;
7544
+ if ("in" in ref$1) refSchema = ref$1.schema;
7258
7545
  if (!refSchema) {
7259
- const contents = mediaTypeObjects({ content: ref.content });
7546
+ const contents = mediaTypeObjects({ content: ref$1.content });
7260
7547
  const content = contents.find((content$1) => content$1.type === "json") || contents[0];
7261
7548
  if (content?.schema) refSchema = content.schema;
7262
7549
  }
@@ -7270,7 +7557,7 @@ const paginationField = ({ context, name, schema }) => {
7270
7557
  return paginationField({
7271
7558
  context,
7272
7559
  name,
7273
- schema: ref
7560
+ schema: ref$1
7274
7561
  });
7275
7562
  }
7276
7563
  for (const name$1 in schema.properties) if (getPaginationKeywordsRegExp(context.config.parser.pagination).test(name$1)) {
@@ -8080,19 +8367,43 @@ const OperationPath = {
8080
8367
 
8081
8368
  //#endregion
8082
8369
  //#region src/openApi/shared/utils/patch.ts
8083
- function patchOpenApiSpec({ patchOptions, spec: _spec }) {
8370
+ async function patchOpenApiSpec({ patchOptions, spec: _spec }) {
8084
8371
  if (!patchOptions) return;
8085
8372
  const spec = _spec;
8373
+ if (typeof patchOptions === "function") {
8374
+ await patchOptions(spec);
8375
+ return;
8376
+ }
8377
+ if (patchOptions.input) await patchOptions.input(spec);
8086
8378
  if ("swagger" in spec) {
8087
8379
  if (patchOptions.version && spec.swagger) spec.swagger = typeof patchOptions.version === "string" ? patchOptions.version : patchOptions.version(spec.swagger);
8088
8380
  if (patchOptions.meta && spec.info) patchOptions.meta(spec.info);
8089
- if (patchOptions.schemas && spec.definitions) for (const key in patchOptions.schemas) {
8381
+ if (patchOptions.schemas && spec.definitions) if (typeof patchOptions.schemas === "function") {
8382
+ for (const [key, schema] of Object.entries(spec.definitions)) if (schema && typeof schema === "object") await patchOptions.schemas(key, schema);
8383
+ } else for (const key in patchOptions.schemas) {
8090
8384
  const schema = spec.definitions[key];
8091
8385
  if (!schema || typeof schema !== "object") continue;
8092
8386
  const patchFn = patchOptions.schemas[key];
8093
- patchFn(schema);
8387
+ await patchFn(schema);
8388
+ }
8389
+ if (patchOptions.operations && spec.paths) if (typeof patchOptions.operations === "function") for (const [path$1, pathItem] of Object.entries(spec.paths)) {
8390
+ if (!pathItem || typeof pathItem !== "object") continue;
8391
+ for (const method of [
8392
+ "get",
8393
+ "put",
8394
+ "post",
8395
+ "delete",
8396
+ "options",
8397
+ "head",
8398
+ "patch",
8399
+ "trace"
8400
+ ]) {
8401
+ const operation = pathItem[method];
8402
+ if (!operation || typeof operation !== "object") continue;
8403
+ await patchOptions.operations(method, path$1, operation);
8404
+ }
8094
8405
  }
8095
- if (patchOptions.operations && spec.paths) for (const key in patchOptions.operations) {
8406
+ else for (const key in patchOptions.operations) {
8096
8407
  const [method, path$1] = key.split(" ");
8097
8408
  if (!method || !path$1) continue;
8098
8409
  const pathItem = spec.paths[path$1];
@@ -8100,18 +8411,20 @@ function patchOpenApiSpec({ patchOptions, spec: _spec }) {
8100
8411
  const operation = pathItem[method.toLocaleLowerCase()] || pathItem[method.toLocaleUpperCase()];
8101
8412
  if (!operation || typeof operation !== "object") continue;
8102
8413
  const patchFn = patchOptions.operations[key];
8103
- patchFn(operation);
8414
+ await patchFn(operation);
8104
8415
  }
8105
8416
  return;
8106
8417
  }
8107
8418
  if (patchOptions.version && spec.openapi) spec.openapi = typeof patchOptions.version === "string" ? patchOptions.version : patchOptions.version(spec.openapi);
8108
8419
  if (patchOptions.meta && spec.info) patchOptions.meta(spec.info);
8109
8420
  if (spec.components) {
8110
- if (patchOptions.schemas && spec.components.schemas) for (const key in patchOptions.schemas) {
8421
+ if (patchOptions.schemas && spec.components.schemas) if (typeof patchOptions.schemas === "function") {
8422
+ for (const [key, schema] of Object.entries(spec.components.schemas)) if (schema && typeof schema === "object") await patchOptions.schemas(key, schema);
8423
+ } else for (const key in patchOptions.schemas) {
8111
8424
  const schema = spec.components.schemas[key];
8112
8425
  if (!schema || typeof schema !== "object") continue;
8113
8426
  const patchFn = patchOptions.schemas[key];
8114
- patchFn(schema);
8427
+ await patchFn(schema);
8115
8428
  }
8116
8429
  if (patchOptions.parameters && spec.components.parameters) for (const key in patchOptions.parameters) {
8117
8430
  const schema = spec.components.parameters[key];
@@ -8132,7 +8445,24 @@ function patchOpenApiSpec({ patchOptions, spec: _spec }) {
8132
8445
  patchFn(schema);
8133
8446
  }
8134
8447
  }
8135
- if (patchOptions.operations && spec.paths) for (const key in patchOptions.operations) {
8448
+ if (patchOptions.operations && spec.paths) if (typeof patchOptions.operations === "function") for (const [path$1, pathItem] of Object.entries(spec.paths)) {
8449
+ if (!pathItem || typeof pathItem !== "object") continue;
8450
+ for (const method of [
8451
+ "get",
8452
+ "put",
8453
+ "post",
8454
+ "delete",
8455
+ "options",
8456
+ "head",
8457
+ "patch",
8458
+ "trace"
8459
+ ]) {
8460
+ const operation = pathItem[method];
8461
+ if (!operation || typeof operation !== "object") continue;
8462
+ await patchOptions.operations(method, path$1, operation);
8463
+ }
8464
+ }
8465
+ else for (const key in patchOptions.operations) {
8136
8466
  const [method, path$1] = key.split(" ");
8137
8467
  if (!method || !path$1) continue;
8138
8468
  const pathItem = spec.paths[path$1];
@@ -8140,7 +8470,7 @@ function patchOpenApiSpec({ patchOptions, spec: _spec }) {
8140
8470
  const operation = pathItem[method.toLocaleLowerCase()] || pathItem[method.toLocaleUpperCase()];
8141
8471
  if (!operation || typeof operation !== "object") continue;
8142
8472
  const patchFn = patchOptions.operations[key];
8143
- patchFn(operation);
8473
+ await patchFn(operation);
8144
8474
  }
8145
8475
  }
8146
8476
 
@@ -8181,5 +8511,109 @@ const utils = {
8181
8511
  };
8182
8512
 
8183
8513
  //#endregion
8184
- export { ConfigError, ConfigValidationError, Context, HeyApiError, IntentContext, JobError, MinHeap, OperationPath, OperationStrategy, PluginInstance, applyNaming, buildGraph, checkNodeVersion, compileInputPath, createOperationKey, debugTools, deduplicateSchema, defaultPaginationKeywords, definePluginConfig, dependencyFactory, encodeJsonPointerSegment, ensureDirSync, escapeComment, findPackageJson, findTsConfigPath, getInput, getLogs, getParser, getSpec, hasOperationDataRequired, hasParameterGroupObjectRequired, hasParametersObjectRequired, heyApiRegistryBaseUrl, inputToApiRegistry, isTopLevelComponentRef, jsonPointerToPath, loadPackageJson, loadTsConfig, logCrashReport, logInputPaths, mappers, normalizeJsonPointer, openGitHubIssueWithCrashReport, operationPagination, operationResponsesMap, parameterWithPagination, parseOpenApiSpec, parseUrl, parseV2_0_X, parseV3_0_X, parseV3_1_X, patchOpenApiSpec, pathToJsonPointer, postprocessOutput, printCliIntro, printCrashReport, refToName, resolveNaming, resolveRef, resolveSource, satisfies, shouldReportCrash, statusCodeToGroup, toCase, utils, valueToObject };
8514
+ //#region src/utils/path.ts
8515
+ /**
8516
+ * After these structural segments, the next segment has a known role.
8517
+ * This is what makes a property literally named "properties" safe —
8518
+ * it occupies the name position, never the structural position.
8519
+ */
8520
+ const STRUCTURAL_ROLE = {
8521
+ items: "index",
8522
+ patternProperties: "name",
8523
+ properties: "name"
8524
+ };
8525
+ /**
8526
+ * These structural segments have no following name/index —
8527
+ * they are the terminal structural node. Append a suffix
8528
+ * to disambiguate from the parent.
8529
+ */
8530
+ const STRUCTURAL_SUFFIX = { additionalProperties: "Value" };
8531
+ /**
8532
+ * Root context configuration.
8533
+ */
8534
+ const ROOT_CONTEXT = {
8535
+ components: {
8536
+ names: 1,
8537
+ skip: 2
8538
+ },
8539
+ definitions: {
8540
+ names: 1,
8541
+ skip: 1
8542
+ },
8543
+ paths: {
8544
+ names: 2,
8545
+ skip: 1
8546
+ },
8547
+ webhooks: {
8548
+ names: 2,
8549
+ skip: 1
8550
+ }
8551
+ };
8552
+ /**
8553
+ * Sanitizes a path segment for use in a derived name.
8554
+ *
8555
+ * Handles API path segments like `/api/v1/users/{id}` → `ApiV1UsersId`.
8556
+ */
8557
+ function sanitizeSegment(segment) {
8558
+ const str = String(segment);
8559
+ if (str.startsWith("/")) return str.split("/").filter(Boolean).map((part) => {
8560
+ const clean = part.replace(/[{}]/g, "");
8561
+ return clean.charAt(0).toUpperCase() + clean.slice(1);
8562
+ }).join("");
8563
+ return str;
8564
+ }
8565
+ /**
8566
+ * Derives a composite name from a path.
8567
+ *
8568
+ * Examples:
8569
+ * .../User → 'User'
8570
+ * .../User/properties/address → 'UserAddress'
8571
+ * .../User/properties/properties → 'UserProperties'
8572
+ * .../User/properties/address/properties/city → 'UserAddressCity'
8573
+ * .../Pet/additionalProperties → 'PetValue'
8574
+ * .../Order/properties/items/items/0 → 'OrderItems'
8575
+ * paths//event/get/properties/query → 'EventGetQuery'
8576
+ *
8577
+ * With anchor:
8578
+ * paths//event/get/properties/query, { anchor: 'event.subscribe' }
8579
+ * → 'event.subscribe-Query'
8580
+ */
8581
+ function pathToName(path$1, options) {
8582
+ const names = [];
8583
+ let index = 0;
8584
+ const rootContext = ROOT_CONTEXT[path$1[0]];
8585
+ if (rootContext) {
8586
+ index = rootContext.skip;
8587
+ if (options?.anchor) {
8588
+ names.push(options.anchor);
8589
+ index += rootContext.names;
8590
+ } else for (let n = 0; n < rootContext.names && index < path$1.length; n++) {
8591
+ names.push(sanitizeSegment(path$1[index]));
8592
+ index++;
8593
+ }
8594
+ } else if (options?.anchor) {
8595
+ names.push(options.anchor);
8596
+ index++;
8597
+ } else if (index < path$1.length) {
8598
+ names.push(sanitizeSegment(path$1[index]));
8599
+ index++;
8600
+ }
8601
+ while (index < path$1.length) {
8602
+ const segment = String(path$1[index]);
8603
+ const role = STRUCTURAL_ROLE[segment];
8604
+ if (role === "name") {
8605
+ index++;
8606
+ if (index < path$1.length) names.push(sanitizeSegment(path$1[index]));
8607
+ } else if (role === "index") {
8608
+ index++;
8609
+ if (index < path$1.length && typeof path$1[index] === "number") index++;
8610
+ continue;
8611
+ } else if (STRUCTURAL_SUFFIX[segment]) names.push(STRUCTURAL_SUFFIX[segment]);
8612
+ index++;
8613
+ }
8614
+ return decodeURI(names.join("-"));
8615
+ }
8616
+
8617
+ //#endregion
8618
+ export { ConfigError, ConfigValidationError, Context, HeyApiError, IntentContext, JobError, MinHeap, OperationPath, OperationStrategy, PluginInstance, addItemsToSchema, applyNaming, buildGraph, checkNodeVersion, childContext, compileInputPath, createOperationKey, createSchemaProcessor, createSchemaWalker, debugTools, deduplicateSchema, defaultPaginationKeywords, definePluginConfig, dependencyFactory, encodeJsonPointerSegment, ensureDirSync, escapeComment, findPackageJson, findTsConfigPath, getInput, getLogs, getParser, getSpec, hasOperationDataRequired, hasParameterGroupObjectRequired, hasParametersObjectRequired, heyApiRegistryBaseUrl, inputToApiRegistry, isTopLevelComponent, jsonPointerToPath, loadPackageJson, loadTsConfig, logCrashReport, logInputPaths, mappers, normalizeJsonPointer, openGitHubIssueWithCrashReport, operationPagination, operationResponsesMap, parameterWithPagination, parseOpenApiSpec, parseUrl, parseV2_0_X, parseV3_0_X, parseV3_1_X, patchOpenApiSpec, pathToJsonPointer, pathToName, postprocessOutput, printCliIntro, printCrashReport, refToName, resolveNaming, resolveRef, resolveSource, satisfies, shouldReportCrash, statusCodeToGroup, toCase, utils, valueToObject };
8185
8619
  //# sourceMappingURL=index.mjs.map