Skip to content

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

@tomflenner-dg

Description

@tomflenner-dg

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

cli/api/v0/sync.yaml

Lines 22 to 47 in 144eb0f

FlagDefaultValue:
description: Default value for a flag (can be boolean, string, integer, or object)
oneOf:
- type: boolean
- type: string
- type: integer
- type: object
ManifestFlag:
type: object
required:
- key
- type
- defaultValue
properties:
key:
type: string
description: Unique flag key within the flag set.
example: search-rollout
name:
type: string
description: Human-friendly flag name. Defaults to the key when omitted.
example: Search rollout
type:
type: string
description: Flag data type.
enum: [boolean, string, integer, object]

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. 👍

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions