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

Classes vs Interfaces? #51

Open
OiNutter opened this issue Jun 1, 2023 · 0 comments
Open

Classes vs Interfaces? #51

OiNutter opened this issue Jun 1, 2023 · 0 comments

Comments

@OiNutter
Copy link

OiNutter commented Jun 1, 2023

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.

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