openfga / openfga/language

Centralize Validation Rules & Store JSON Schema

Open
#302 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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:

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.