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

Config data validation and coercion using Yup #53

Open
monarchwadia opened this issue Jun 26, 2021 · 1 comment
Open

Config data validation and coercion using Yup #53

monarchwadia opened this issue Jun 26, 2021 · 1 comment

Comments

@monarchwadia
Copy link
Member

monarchwadia commented Jun 26, 2021

Currently, we are not running any validation on the data received from configs except simple presence/absence of the value. See screenshot.

image

We are also simply converting the data from string to number in a few places. See screenshot.

image

Instead of these methods, use Yup to validate and convert data in the configProvider.

@monarchwadia monarchwadia changed the title Config data validation Config data validation using Yup Jun 26, 2021
@monarchwadia monarchwadia changed the title Config data validation using Yup Config data validation and coercion using Yup Jun 26, 2021
@kharakkular
Copy link
Contributor

I have used the getConfig function that takes 1 string parameter and return string. All the other properties will be converted to their appropriate type using cast method of Yup.

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

2 participants