openapi-typescript
Advanced tools
Comparing version 7.0.1 to 7.0.2
# openapi-typescript | ||
## 7.0.2 | ||
### Patch Changes | ||
- [#1743](https://github.com/openapi-ts/openapi-typescript/pull/1743) [`8f6ec20`](https://github.com/openapi-ts/openapi-typescript/commit/8f6ec20d5d26396c1745690f0e42675776e1a691) Thanks [@avaly](https://github.com/avaly)! - Generate valid types for referenced nested properties | ||
## 7.0.1 | ||
@@ -4,0 +10,0 @@ |
@@ -77,2 +77,5 @@ import { parseRef } from "@redocly/openapi-core/lib/ref-utils.js"; | ||
for (let i = 1; i < pointer.length; i++) { | ||
if (i > 2 && i < pointer.length - 1 && pointer[i] === "properties") { | ||
continue; | ||
} | ||
t = ts.factory.createIndexedAccessTypeNode(t, ts.factory.createLiteralTypeNode(typeof pointer[i] === "number" | ||
@@ -79,0 +82,0 @@ ? ts.factory.createNumericLiteral(pointer[i]) |
@@ -16,2 +16,3 @@ import ts from "typescript"; | ||
addJSDocComment(pathItemObject, property); | ||
type.push(property); | ||
} | ||
@@ -18,0 +19,0 @@ else { |
{ | ||
"name": "openapi-typescript", | ||
"description": "Convert OpenAPI 3.0 & 3.1 schemas to TypeScript", | ||
"version": "7.0.1", | ||
"version": "7.0.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Drew Powers", |
@@ -125,2 +125,7 @@ import { parseRef } from "@redocly/openapi-core/lib/ref-utils.js"; | ||
for (let i = 1; i < pointer.length; i++) { | ||
// Skip `properties` items when in the middle of the pointer | ||
// See: https://github.com/openapi-ts/openapi-typescript/issues/1742 | ||
if (i > 2 && i < pointer.length - 1 && pointer[i] === "properties") { | ||
continue; | ||
} | ||
t = ts.factory.createIndexedAccessTypeNode( | ||
@@ -127,0 +132,0 @@ t, |
@@ -38,2 +38,3 @@ import ts from "typescript"; | ||
addJSDocComment(pathItemObject, property); | ||
type.push(property); | ||
} else { | ||
@@ -40,0 +41,0 @@ const pathItemType = transformPathItemObject(pathItemObject, { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
531452
10055