Rewrite ddoc validation routines
While it solve the own problem well, it contains few design issues that
makes unable to keep it for further updates:
1. It's type-centric validation. However, our ddocs have quite complex
structure and validation logic, so it eventually have to write special
clause for most of the validated fields turning it into field-centric.
2. It mixes logic of type checking and relation checking.
Here we turn it into rule based validation where each rule is a path of
field-type pairs while all relation checks are moved into own functions.
Moreover, we can now exactly say the path for the field that caused
issues.
2 files changed