language icon indicating copy to clipboard operation
language copied to clipboard

Centralize Validation Rules & Store JSON Schema

Open d-jeffery opened this issue 7 months ago • 0 comments

Currently each language has its own validation rules and implementation. This means updating the regex rules will require a change and release of every pkg. Likewise, the schema for validation of the store files currently lives in code and is not being shared.

Rules:

  • https://github.com/openfga/language/blob/main/pkg/js/validator/validate-rules.ts#L1-L49
  • https://github.com/openfga/language/blob/main/pkg/java/src/main/java/dev/openfga/language/validation/Validator.java#L5-L70
  • https://github.com/openfga/language/blob/main/pkg/go/validation/validation-rules.go#L8-L64

Schema:

  • https://github.com/openfga/language/blob/main/pkg/js/validator/validate-store.ts#L847-L1013

Figure out a way to share the JSON schema between all 3 implementations, and centralize the regex rule patterns to reduce number of touch points on release.

d-jeffery avatar Jul 29 '24 16:07 d-jeffery