Skip to content

OpenAPI drift: 4 gaps between live spec and library #212

@github-actions

Description

@github-actions

The live ClickHouse Cloud OpenAPI spec has operations or schemas that the
Rust library (client.rs / models.rs) does not cover yet.

  • Live spec: https://api.clickhouse.cloud/v1
  • Client: crates/clickhouse-cloud-api/src/client.rs
  • Models: crates/clickhouse-cloud-api/src/models.rs
  • Beta metadata: crates/clickhouse-cloud-api/src/meta.rs

Summary

Change Count
Missing client methods 0
Extra client methods (not in spec) 0
Missing model types 1
Missing struct fields 2
Field optionality mismatches 0
Beta status changes 0
Stale snapshot changes 1

Missing Model Types

The live spec defines these schemas but models.rs has no matching
pub struct, pub enum, or pub type.

CustomPrivateDnsMapping (spec name: CustomPrivateDnsMapping)

Schema JSON
{
  "properties": {
    "privateDnsName": {
      "description": "Custom private DNS name managed by the DNS controller. No Route53 hosted zone is required.",
      "type": "string",
      "example": "my-service.example.com"
    }
  }
}

Missing Struct Fields

These properties exist in the OpenAPI spec but have no corresponding
field in the Rust struct. API response data for these fields is silently
dropped during deserialization.

Schema Field
CreateReversePrivateEndpoint customPrivateDnsMappings
ReversePrivateEndpoint customPrivateDnsMappings

Stale Snapshot

The committed clickhouse_cloud_openapi.json is behind the live spec.
Tests that run against the snapshot may pass even though the library is
missing coverage for new endpoints or schemas.

New schemas in live spec (not in snapshot):

  • CustomPrivateDnsMapping

Implementation Guide

  1. Update the checked-in spec:
    curl -s https://api.clickhouse.cloud/v1 -o crates/clickhouse-cloud-api/clickhouse_cloud_openapi.json
  2. Add missing types to crates/clickhouse-cloud-api/src/models.rs
    • Use #[serde(rename_all = "camelCase")] on structs
    • Use #[serde(skip_serializing_if = "Option::is_none")] for optional fields
    • Enums should derive Default and include an #[serde(other)] Unknown variant
  3. Add missing methods to crates/clickhouse-cloud-api/src/client.rs
  4. Fix any field optionality mismatches by hand-editing models.rs
    (flip TOption<T> and the matching skip_serializing_if attribute).
  5. Verify: cargo test -p clickhouse-cloud-api

Metadata

Metadata

Assignees

Labels

openapi-driftAutomated: live OpenAPI spec has operations/schemas not covered by the Rust library

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions