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

Initial implementation of new validation approach #1

Merged
merged 1 commit into from
Feb 10, 2020

Conversation

adamconnelly
Copy link
Owner

I've altered the way that the deserializers work and are defined so that they are simpler to create, but also so that we can record validation failures during the deserialization process. This allows us to provide much better validation messages than we can if we take the approach of validating based on the deserialized objects.

In this initial change I haven't gone ahead and updated all of the deserializers because I wanted the change to be kept small. I've also not actually hooked up the validation messages in any way - instead I've just provided a stub ErrorReporter object that doesn't actually do anything yet.

Fixes #

Copy link

@tomkerkhove tomkerkhove left a comment

Choose a reason for hiding this comment

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

Added a few remarks questions, but overall looks good - Thanks man!

// TODO: Check for invalid formats (crontab expression, timespan, etc)
// TODO: Add a test to make sure that the error is against the mapping node rather than its value for missing required fields

private class TestConfigObject

Choose a reason for hiding this comment

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

Same about those, dedicated files for final PR


// TODO: Test for duplicate field registration

private class RegistrationConfig

Choose a reason for hiding this comment

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

Same here, dedicated files for final PR

I've altered the way that the deserializers work and are defined so that they are simpler to create, but also so that we can record validation failures during the deserialization process. This allows us to provide much better validation messages than we can if we take the approach of validating based on the deserialized objects.

In this initial change I haven't gone ahead and updated all of the deserializers because I wanted the change to be kept small. I've also not actually hooked up the validation messages in any way - instead I've just provided a stub ErrorReporter object that doesn't actually do anything yet.
@adamconnelly adamconnelly merged commit 4b3f3f6 into validation-improvements Feb 10, 2020
@adamconnelly adamconnelly deleted the validation-stage-1 branch February 10, 2020 17:30
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.

2 participants