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

Possible feature: validation of data coming from the API to prevent looping #552

Open
PabloSzx opened this issue Jan 17, 2022 · 1 comment
Labels
bug-on-server-side enhancement New feature or request help wanted Extra attention is needed question Further information is requested

Comments

@PabloSzx
Copy link
Member

Related to #520

Would actually be possible to validate the data coming from the API to prevent situations like #520 where gqty is not the one at fault?

@PabloSzx PabloSzx added enhancement New feature or request help wanted Extra attention is needed question Further information is requested bug-on-server-side labels Jan 17, 2022
@vicary
Copy link
Member

vicary commented Jan 17, 2022

We definitely don't want to validate too much (ajv as an extreme case), that defeats the benefits of TypeScript.

I suggest minimal assertions, e.g. invariant or assert, with a message containing enough information for users to start looking at server side.

invariant(data.allMfes0, "Response with alias `allMfes0` expected.");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-on-server-side enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants