Hyral icon indicating copy to clipboard operation
Hyral copied to clipboard

Add JSON schema support for validation and relationships decoration

Open mnugter opened this issue 5 years ago • 1 comments

  1. Define a superset for JSON schema which adds cardinality support in #ref tags.
  2. Create a factory method to create the relationship decorator from a JSON schema
  3. Add Resource decorator for validating data when setting the data property.

Create this as a separate package. The package should introduce a helper method that accepts a JSON schema and initializes the relationship and validator decorators on the Resource.

mnugter avatar Jun 01 '19 08:06 mnugter

As a JSON schema is a description of a single resource adding support via the repository seems logical.

Relationships:

  • Somehow add the ability to register a JSON schema on repository level (use a decorator that adds this feature)
  • Then add a Resource decorator to read the relationships from JSON schema you can get via the repository manager

Validation:

  • Find a good validation library and add a decorator that validates the data on setting the data property.

mnugter avatar Jul 31 '19 09:07 mnugter