open-feature / open-feature/cli

chore(sync/openapi): align flag types with OpenFeature spec (add float)

Open
#229 3 comments 0 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

While working with the sync OpenAPI specification in openfeature/cli, I noticed an inconsistency regarding numeric flag types, specifically missing support for floating-point values.

Current OpenAPI definition

https://github.com/open-feature/cli/blob/144eb0f0e3b2c53c9ae99e1d671259306fe474d0/api/v0/sync.yaml#L22-L47

Both:

are missing a floating-point / number representation.

Why this is incorrect per OpenFeature spec

https://openfeature.dev/specification/sections/flag-evaluation/#conditional-requirement-1331
https://openfeature.dev/specification/types/#number

This clearly establishes that floating-point values are a first-class concept in OpenFeature.

Existing manifest schema already supports floats : the current v0 flag manifest JSON Schema already allows float flags: flag-manifest.json#L37

This creates a mismatch where:

  • JSON Schema ✅ allows float flags
  • Sync OpenAPI spec ❌ does not

Impact

Because floating-point is missing from the OpenAPI spec:

  • Code generation for provider servers becomes incorrect or incomplete

Suggested fix

Add number (or float) to:

  • FlagDefaultValue.oneOf
  • ManifestFlag.type.enum

I’m happy to provide a PR once the expected direction is agreed upon. 👍

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 with the referenced definitions in api/v0/sync.yaml, especially FlagDefaultValue.oneOf and ManifestFlag.type.enum, and compare them with schema/v0/flag-manifest.json and the OpenFeature number type. Done means the sync OpenAPI definition represents floating-point flags consistently in both locations and no longer conflicts with the existing manifest schema.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.