openfga / openfga/api

Make required fields required

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

Nobody has claimed this yet.

breaking-change
Dominant language
Go
Stars
27
Forks
24
Avg merge
12d 6h
Merged PRs (30d)
1

Description

This includes:

  • In WriteAuthorizationModelRequest, schema_version should be required
  • In ReadAuthorizationModelRequest, id should be required
  • In TupleKey all are required
  • All responses

These currently cause a lot of DX problems in the SDKs, as the generated types show that the fields are optional.

E.g. In the typescript SDK, users have to check for nullability on responses even if we know it will never be null, and they mistakenly think that some fields are optional in requests even when they are.

In the Go SDK, we have to make the fields accept pointer instead of values because of this when it is unnecessary

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

The issue names WriteAuthorizationModelRequest, ReadAuthorizationModelRequest, TupleKey, all responses, and the generated TypeScript and Go SDK types. Start by locating the Protocol Buffer definitions for these messages and inspecting how requiredness appears in generated types; done means the named request and response fields are non-optional without unnecessary pointers.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
api, developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.