Skip to content

Model acknowledged OpenAPI enum constraints as typed Rust values #296

Description

@sdairs

Context

Follow-up to #297, which implements #295 on top of #290.

The shared OpenAPI drift analyzer inventories every enum constraint, including locations that are not currently backed by concrete Rust value enums. Eleven existing locations are acknowledged so the analyzer refit can land without mixing in public model/API remediation.

This issue tracks replacing those scalar-backed constraints with typed Rust representations, or documenting a deliberate reason to retain a scalar type.

Locations

Array item enums modeled as strings

  • ServiceQueryAPIEndpoint.roles
  • InstanceServiceQueryApiEndpointsPostRequest.roles
  • ApiKey.roles
  • ApiKeyPostRequest.roles
  • ApiKeyPatchRequest.roles
  • ByocInfrastructurePostRequest.availabilityZoneSuffixes

Numeric enums modeled as integers

  • UpgradeWindow.startHourUtc
  • UpgradeWindow.duration
  • UpgradeWindowPutRequest.startHourUtc

Operation parameters modeled as &str

  • slow_query_patterns_get_list.sort_by
  • slow_query_patterns_get_list.sort_order

Implementation notes

  • Review request and response compatibility before changing exported clickhouse-cloud-api types; some conversions may be breaking.
  • Add typed enums or constrained newtypes with Serde wire values matching the OpenAPI document.
  • Update client signatures, model tests, and affected callers as appropriate.
  • Remove each JSON-pointer acknowledgement from ACKNOWLEDGED_UNSUPPORTED_ENUM_POINTERS as its location becomes checkable. The analyzer will flag acknowledgements that become stale.

Acceptance criteria

  • Each of the 11 locations is either represented by a typed Rust value or has an explicit, reviewed justification for remaining scalar-backed.
  • Remediated locations are checked bidirectionally by the shared analyzer.
  • Corresponding acknowledgement entries are removed.
  • cargo test --workspace passes.
  • cargo clippy --workspace --all-targets -- -D warnings passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttest-coverageLive API integration test coverage work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions