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

[JsonSchema] Rework Validation (part1) #640

Merged
merged 2 commits into from Sep 15, 2022

Conversation

Korbeil
Copy link
Member

@Korbeil Korbeil commented Aug 5, 2022

Biggest current issue with validation is that Validation is done on each models one by one with no relations.
So if we have a model with a property that is another model, we won't keep the path to the validated properties in that sub-model.

The idea is to use one native Compound Constraint for each model, then to use theses constraints to validate sub-models properties.

Part 1 contains:

  • Use Symfony Constraints instead of custom validators
  • Make only the first Normalizer to do the validation

Part 2 will contains:

  • Use theses Constraints to validate sub-models
  • Add tests on sub-models validation

While we could wait for both part 1 & 2, I think part 1 is already a big step forward and considering the diff it makes, it's better to merge it now to avoid issues while rebasing.

@Korbeil Korbeil force-pushed the feature/rework-validation branch 2 times, most recently from 497af6d to 4dbfddc Compare August 5, 2022 14:13
@Korbeil Korbeil changed the title [JsonSchema] Rework Validation [JsonSchema] Rework Validation (part1) Sep 15, 2022
@Korbeil Korbeil merged commit b6b9949 into janephp:next Sep 15, 2022
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.

None yet

1 participant