TransformJSONProtoToDSL fails for models with direct assignments
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 35
- Forks
- 17
- Avg merge
- 48m
- Merged PRs (30d)
- 10
Description
TransformJSONProtoToDSL can fail when given an AuthorizationModel produced by TransformModuleFilesToModel, even though the
model represents valid DSL.
reproduce
user := `
module user
type user
`
group := `
module group
type group
relations
define member: [user]
`
model, err := transformer.TransformModuleFilesToModel([]transformer.ModuleFile{
{Name: "user.fga", Contents: user},
{Name: "group.fga", Contents: group},
}, "1.2")
if err != nil {
panic(err)
}
_, err = transformer.TransformJSONProtoToDSL(
model,
transformer.WithIncludeSourceInformation(true),
)
my expectation was that this would return the full compiled DSL model, similar to the output of the FGA cli fga model transform
but it fails with
the 'member' relation definition under the 'group' type is not supported by the OpenFGA DSL syntax yet
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
Start with TransformModuleFilesToModel and TransformJSONProtoToDSL, using the provided user and group module inputs to reproduce the failure. Trace handling of the direct assignment in the group member relation; done means the transformation returns the full compiled DSL model without the unsupported-syntax error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100