Skip to content

Classes vs Interfaces? #51

@OiNutter

Description

@OiNutter

First big difference I'm noticing with this compared to swagger-typescript-api is that it generates classes for the API models rather than interfaces. This seems to cause us some issues with required fields (as described in #50) but potentially avoids duplication when extending the class.

Interfaces would avoid the initialisation warnings but only provided a guide for which fields needs to be added when creating a class that implements them, causing duplication. Additionally they may not flag errors in initialisation of non-null properties with null values due to API errors.

Probably worth some thought and investigation as to pros and cons of each, and whether we pick one and be opinionated about it, or maybe give the user the option of one of the other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions