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
tree: ba855e6227978465945d8794efbe0ab2406808dc
  1. include/
  2. priv/
  3. src/
  4. test/
  5. .travis.yml
  6. LICENSE