-
-
Notifications
You must be signed in to change notification settings - Fork 576
Closed
Labels
3.0Part of OpenAPI 3.9Part of OpenAPI 3.93.1Part of OpenAPI 3.1Part of OpenAPI 3.1bugSomething isn't workingSomething isn't working
Description
According to https://swagger.io/docs/specification/data-models/data-types/
A free-form object (arbitrary property/value pairs) is defined as:
type: object
This is equivalent to
type: object
additionalProperties: true
and
type: object
additionalProperties: {}
However for such a schema:
"data": { "type": "object", "additionalProperties": {} }
it is generated:
data?: { [key: string]: Record<string, never> | undefined; };
Record<string, never> is "empty object" but incorrect as free-form object.
If we change additionalProperties: true
we get correct.
data?: { [key: string]: unknown | undefined; };
Metadata
Metadata
Assignees
Labels
3.0Part of OpenAPI 3.9Part of OpenAPI 3.93.1Part of OpenAPI 3.1Part of OpenAPI 3.1bugSomething isn't workingSomething isn't working