Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/v3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/v3/expected/stripe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*/
Expand Down
8 changes: 8 additions & 0 deletions tests/v3/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
}
}
},
},
};
Expand All @@ -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[] };
}
}`)
);
Expand Down