language
language copied to clipboard
Centralize Validation Rules & Store JSON Schema
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.