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

Array fields always as any if type specified as array #893

Open
hlavavit opened this issue Aug 16, 2024 · 0 comments
Open

Array fields always as any if type specified as array #893

hlavavit opened this issue Aug 16, 2024 · 0 comments

Comments

@hlavavit
Copy link

I got this kind of property on my object

        permissions:
          type: 
            - array
          items:
            enum:
              - DEBUG
              - EDIT
            type: string

it end up being generated as

  permissions: any[];

but when i change it to

        permissions:
          type: array
          items:
            enum:
              - DEBUG
              - EDIT
            type: string

it suddenly works and generates as

permissions: ("DEBUG" | "EDIT")[];

Happens with objects as well not just enums.

And it happens with json format as well there it works with "type":"array" and does not with "type":["array"]

Its needed for nullable arrays for example "type":["array","null"] since nullable has been removed with 3.1

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

No branches or pull requests

1 participant