Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Commit 1ac06a0

Browse files
authored
Merge pull request #169 from seamapi/allow-additional-properties
fix: set additionalProperties to true for backwards compatibility with new model attributes added
2 parents d67c28e + 428daf0 commit 1ac06a0

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/fixtures/helpers/get-model-schemas.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ const getModelSchemas = () => {
77
// Add array definitions so we can use "Type[]" syntax e.g. "AccessCode[]" in
88
// tests
99
for (const tName of Object.keys(schemas.definitions)) {
10-
;(schemas as any).definitions[`${tName}[]`] = {
10+
const schemas_typed_as_any = schemas as any
11+
const model_definition = schemas_typed_as_any.definitions[tName]
12+
if (model_definition.type === "object") {
13+
model_definition.additionalProperties = true
14+
}
15+
schemas_typed_as_any.definitions[`${tName}[]`] = {
1116
items: {
1217
$ref: `#/definitions/${tName}`,
1318
},

0 commit comments

Comments
 (0)