Skip to content

Conversation

@mpugach
Copy link

@mpugach mpugach commented Jan 14, 2020

In some cases, it is suitable to have subtypes of the model.

For example, the Author and Consumer both extend User. So /users endpoint serves heterogeneous types.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.176% when pulling a44cd5b on mpugach:set_model_based_on_its_type into 378c4dd on ghidoz:master.


body.data.forEach((data: any) => {
const model: T = this.deserializeModel(modelType, data);
const model: T = this.deserializeModel(this.datastoreConfig.models[data.type], data);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we still default to modelType though? So that it doesn't fail in the rare case there is no type field?

Copy link
Author

@mpugach mpugach Jul 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, looks like it is a good idea

maybe it needs some documentation also, do not remember

anyway we ended up ejecting the library from our projects due to the lack of responsiveness to our PRs

so I do not feel like continuing with this one. I gonna close the PRs

thank you for your comment

@mpugach mpugach closed this Jul 23, 2020
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

Successfully merging this pull request may close these issues.

3 participants