Centralize Validation Rules & Store JSON Schema
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 35
- Forks
- 17
- Avg merge
- 48m
- Merged PRs (30d)
- 10
Description
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:
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the rule definitions in pkg/js/validator/validate-rules.ts, pkg/java/src/main/java/dev/openfga/language/validation/Validator.java, and pkg/go/validation/validation-rules.go. Read the store schema in pkg/js/validator/validate-store.ts, lines 847-1013, then determine a shared arrangement for the schema and regex patterns. Done means all three implementations use the centralized definitions and have fewer release touch points.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, java, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100