diff --git a/src/v3.ts b/src/v3.ts index ce9bbe12a..220963cbd 100644 --- a/src/v3.ts +++ b/src/v3.ts @@ -74,7 +74,7 @@ export default function generateTypesV3( // if additional properties, add to end of properties if (node.additionalProperties) { properties += `[key: string]: ${ - nodeType(node.additionalProperties) || "any" + transform(node.additionalProperties as any) || "any" };\n`; } diff --git a/tests/v3/expected/stripe.ts b/tests/v3/expected/stripe.ts index a50bab0b0..67e18e5dd 100644 --- a/tests/v3/expected/stripe.ts +++ b/tests/v3/expected/stripe.ts @@ -1744,7 +1744,7 @@ export interface components { /** * Currencies that can be accepted in the specific country (for transfers). */ - supported_bank_account_currencies: { [key: string]: array }; + supported_bank_account_currencies: { [key: string]: string[] }; /** * Currencies that can be accepted in the specified country (for payments). */ diff --git a/tests/v3/index.test.ts b/tests/v3/index.test.ts index 7de9bdc3d..91a83232e 100644 --- a/tests/v3/index.test.ts +++ b/tests/v3/index.test.ts @@ -279,6 +279,13 @@ describe("OpenAPI3 features", () => { properties: { string: { type: "string" } }, additionalProperties: { type: "string" }, }, + additional_properties_array: { + type: "object", + additionalProperties: { + type: "array", + items: { type: "number"}, + } + } }, }, }; @@ -288,6 +295,7 @@ describe("OpenAPI3 features", () => { schemas: { additional_properties: { number?: number; [key: string]: any }; additional_properties_string: { string?: string; [key: string]: string }; + additional_properties_array: { [key:string]: number[] }; } }`) );