Skip to content

Record<string,never> is missrepresented #1821

@Amphaal

Description

@Amphaal

Follow up to #1535.

Per https://www.learnjsonschema.com/2020-12/applicator/additionalproperties/ , a strict, empty {} should be represented in this form:

{
  "type": "object",
  "properties": {},
  "additionalProperties": false
}

As of today stable release ([email protected]), we are getting

{
  "type": "object",
  "properties": {},
  "description": "Construct a type with a set of properties K of type T"
}

As a side note, I'd like to point that the equivalent of Record<string, never> in interface form, eg:

interface foo {
  [key: string]: never;
}

... do not transpile at all, resulting in a nasty GenerateMetadataError: Unknown type: NeverKeyword. I think both forms should be handled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions