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

Typescript generator incorrect array type generation #864

Closed
bassedOutt opened this issue Oct 26, 2023 · 2 comments
Closed

Typescript generator incorrect array type generation #864

bassedOutt opened this issue Oct 26, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@bassedOutt
Copy link

I have a following schema in my asyncapi file

    SomeRequest:
      type: object
      properties:
        someArray:
          uniqueItems: true
          type: array
          description: Some description
          items:
            type: integer
            format: int64

Here's the generated model

interface SomeRequest {
 someArray: (number | any)[];
}
export default SomeRequest;

I expect someArray to be number[] not of any type. Looking through the documentation, I did not find such configuration/workaround

@bassedOutt bassedOutt added the bug Something isn't working label Oct 26, 2023
@github-actions
Copy link
Contributor

Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@jonaslagoni
Copy link
Member

Problem as been solved in Modelina v2, but not yet upgraded on the CLI.

The workaround is to set additionalItems: false on the array.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants