You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validation of each rootProperty currently starts with a common block:
Make sure that the given value is an object
Validate the object as a RootProperty: Use the RootPropertyValidator to check that extensions and extras have a proper JSON structure)
Perform the validation of the object in view of the extensions that it may contain: Use the ExtendedObjectsValidators to check whether the object contains a known extension object, and whether a special Validator was registered for that case
If there was an extension validator that overrides the default validation, then skip the remaining validation.
It might also be worth considering to model the validation process more generally and explicitly as some sort of "chain", roughly as in the pseudocode
let result = true;
for (const step of chain) {
const stepResult = step.apply(input);
if (!stepResult.valid) result = false;
if (!stepResult.continueValidation) break;
}
The redundancy for now is not so high that it would warrant larger engineering efforts. But eventually, this could lead to a more flexible (and extensible) validation process in general, so should be considered at some point in time.
The text was updated successfully, but these errors were encountered:
The validation of each
rootProperty
currently starts with a common block:RootPropertyValidator
to check thatextensions
andextras
have a proper JSON structure)ExtendedObjectsValidators
to check whether the object contains a known extension object, and whether a specialValidator
was registered for that caseIt might also be worth considering to model the validation process more generally and explicitly as some sort of "chain", roughly as in the pseudocode
The redundancy for now is not so high that it would warrant larger engineering efforts. But eventually, this could lead to a more flexible (and extensible) validation process in general, so should be considered at some point in time.
The text was updated successfully, but these errors were encountered: