Skip to content

incorrect Free-Form Object on v6 #981

@leppaott

Description

@leppaott

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

No one assigned

    Labels

    3.0Part of OpenAPI 3.93.1Part of OpenAPI 3.1bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions