Skip to content

In the TypeScript Generator, the generated code has to be tweaked to add defaults to required properties. #49

@ms14981

Description

@ms14981

Using the pet store example, when first trying to run it, you get:

model.ts(250,10): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor.
model.ts(252,10): error TS2564: Property 'photoUrls' has no initializer and is not definitely assigned in the constructor.

These are required properties. Is there a way we can prevent these errors? Adding a tsconfig.json to the generated code is one option: https://stackoverflow.com/a/50241920/

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions