@kubb/adapter-oas 5.0.0-beta.14 → 5.0.0-beta.15

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/adapter-oas",
3
- "version": "5.0.0-beta.14",
3
+ "version": "5.0.0-beta.15",
4
4
  "description": "OpenAPI and Swagger adapter for Kubb. Parses and validates OAS 2.0/3.x specifications into a @kubb/ast RootNode for downstream code generation plugins.",
5
5
  "keywords": [
6
6
  "adapter",
@@ -47,7 +47,7 @@
47
47
  "oas": "^32.1.18",
48
48
  "oas-normalize": "^16.0.4",
49
49
  "swagger2openapi": "^7.0.8",
50
- "@kubb/core": "5.0.0-beta.14"
50
+ "@kubb/core": "5.0.0-beta.15"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/swagger2openapi": "^7.0.4",
package/src/parser.ts CHANGED
@@ -98,7 +98,7 @@ function createSchemaParser(ctx: OasParserContext) {
98
98
  * blowup — `customer` alone may be referenced from dozens of top-level schemas,
99
99
  * each triggering a fresh recursive expansion of its entire sub-tree.
100
100
  *
101
- * Memoising by `$ref` path reduces the overall work from O(2^depth) to O(N)
101
+ * Memoizing by `$ref` path reduces the overall work from O(2^depth) to O(N)
102
102
  * where N is the number of unique schema names.
103
103
  */
104
104
  const resolvedRefCache = new Map<string, ast.SchemaNode | undefined>()
@@ -245,7 +245,7 @@ function createSchemaParser(ctx: OasParserContext) {
245
245
 
246
246
  return ast.createSchema({
247
247
  type: 'intersection',
248
- members: [...ast.mergeAdjacentObjects(allOfMembers.slice(0, syntheticStart)), ...ast.mergeAdjacentObjects(allOfMembers.slice(syntheticStart))],
248
+ members: [...ast.mergeAdjacentObjectsLazy(allOfMembers.slice(0, syntheticStart)), ...ast.mergeAdjacentObjectsLazy(allOfMembers.slice(syntheticStart))],
249
249
  ...buildSchemaNode(schema, name, nullable, defaultValue),
250
250
  })
251
251
  }
@@ -1009,7 +1009,7 @@ export function parseOas(
1009
1009
  const baseOas = new BaseOas(document)
1010
1010
  const paths = baseOas.getPaths()
1011
1011
 
1012
- const operations: Array<ast.OperationNode> = Object.entries(paths).flatMap(([_path, methods]) =>
1012
+ const operations: Array<ast.OperationNode> = Object.entries(paths).flatMap(([, methods]) =>
1013
1013
  Object.entries(methods)
1014
1014
  .map(([, operation]) => (operation ? _parseOperation(mergedOptions, operation) : null))
1015
1015
  .filter((op): op is ast.OperationNode => op !== null),