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

feat: add data model validation #43

Merged
merged 22 commits into from
Aug 19, 2024
Merged

feat: add data model validation #43

merged 22 commits into from
Aug 19, 2024

Conversation

lukasbicus
Copy link
Contributor

closes #17

@lukasbicus
Copy link
Contributor Author

@xseman - can you please give feedback?

  • There are 3 direct questions on task definition marked with todo in the code, please take a look at them.

@xseman xseman self-requested a review August 19, 2024 06:23
src/encode.ts Outdated
Comment on lines 183 to 188
/**
* If true, validates data model before encoding it.
*
* @default false
*/
validateModel: boolean;
Copy link
Owner

@xseman xseman Aug 19, 2024

Choose a reason for hiding this comment

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

I initially suggested a default of false, but after thinking it over, I believe true would be more expected. Also, a simple validate option would be nicer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@xseman - this will cause validation to run by default in the terminal without an option to turn it out. Should I add an optional flag withoutValidation to the cli command?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Owner

Choose a reason for hiding this comment

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

@xseman - this will cause validation to run by default in the terminal without an option to turn it out. Should I add an optional flag withoutValidation to the cli command?

Great, I almost forgot about the CLI. Sure, go ahead and add it as a simple validation option.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/validations.ts Outdated Show resolved Hide resolved
src/validations.ts Outdated Show resolved Hide resolved
src/validations.test.ts Outdated Show resolved Hide resolved
@xseman
Copy link
Owner

xseman commented Aug 19, 2024

Thanks for your contribution @lukasbicus!
Great implementation and tests, I've left a few comments.

@xseman xseman merged commit f969570 into xseman:master Aug 19, 2024
2 checks passed
@xseman xseman mentioned this pull request Aug 19, 2024
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.

feat: add data model validation
2 participants