open-feature / open-feature/cli

Add new field "accessor" to schema

Open
#164 6 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
63
Forks
22
Avg merge
1h 27m
Merged PRs (30d)
19

Description

The name/key of the flag does not always make for a good variable name. Allow the user to optionally specify what the generated variable name should be for a flag using an "accessor" field in the flag manifest. An example is the hypothetical flag named "enable-api". In Go, this will generate a variable called EnableApi, which does not follow Go's initialism conventions: I would want to name it EnableAPI instead.

https://github.com/open-feature/cli/blob/f26020988f13127d58177cb824ffd3182ad46b80/internal/generators/golang/golang.tmpl#L25

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

Start by tracing how the flag manifest is parsed and how the generated name reaches internal/generators/golang/golang.tmpl. Add support for the optional accessor field so enable-api can generate EnableAPI instead of EnableApi. Confirm the generated Go output uses the accessor when provided and preserves existing naming when it is absent.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.