Skip to content

Commit

Permalink
Additional properties should add to a basic type as opposed to replac…
Browse files Browse the repository at this point in the history
…ing it with a Record type
  • Loading branch information
nicolas-chaulet committed Feb 1, 2024
1 parent 74adb1a commit 7eb045c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nicolas-chaulet/openapi-typescript-codegen",
"version": "0.27.2",
"version": "0.27.3",
"description": "Library that generates Typescript clients based on the OpenAPI specification.",
"author": "Ferdi Koomen",
"homepage": "https://github.com/CanoaPBC/openapi-typescript-codegen",
Expand Down
4 changes: 3 additions & 1 deletion test/__snapshots__/index.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4565,7 +4565,9 @@ exports[`v3 should generate: test/generated/v3/models/FreeFormObjectWithAddition
/**
* This is a free-form object with additionalProperties: true.
*/
export type FreeFormObjectWithAdditionalPropertiesEqTrue = Record<string, any>;
export type FreeFormObjectWithAdditionalPropertiesEqTrue = {
foo?: string;
} & Record<string, any>;
"
`;

Expand Down
7 changes: 6 additions & 1 deletion test/spec/v3.json
Original file line number Diff line number Diff line change
Expand Up @@ -2712,7 +2712,12 @@
"FreeFormObjectWithAdditionalPropertiesEqTrue": {
"description": "This is a free-form object with additionalProperties: true.",
"type": "object",
"additionalProperties": true
"additionalProperties": true,
"properties": {
"foo": {
"type": "string"
}
}
},
"FreeFormObjectWithAdditionalPropertiesEqEmptyObject": {
"description": "This is a free-form object with additionalProperties: {}.",
Expand Down

0 comments on commit 7eb045c

Please sign in to comment.