Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[key: number] implementation is incorrectly open-ended, like [key: string] #2134

Open
Logopher opened this issue Dec 14, 2024 · 1 comment
Open

Comments

@Logopher
Copy link

I have a type like this:

export type List<T> = { [index: number]: T };

The generator writes it like this (for List):

{
  "additionalProperties": {
    "$ref": "#/definitions/Column"
  },
  "type": "object"
}

I think it should be this:

{
  "patternProperties": {
    "^[0-9]+$": { "$ref": "#/definitions/Column" }
  },
  "type": "object"
}
@domoritz
Copy link
Member

It's it incorrect but could be more narrow. Happy to review a pull request that improves this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants