Skip to content

fix: account status login, property renames, integer ids#34

Merged
RAprogramm merged 4 commits into
mainfrom
fix-account-status-login
Jun 30, 2026
Merged

fix: account status login, property renames, integer ids#34
RAprogramm merged 4 commits into
mainfrom
fix-account-status-login

Conversation

@RAprogramm

Copy link
Copy Markdown
Owner

Normalizer-driven SDK fixes (all in openapi/normalize_spec.py, regenerated):

  • Add undocumented account status.login and related fields.
  • Rename mismatched properties (ssh-keys, knowledge_bases) and relax over-strict required/enum constraints so apps, databases, floating IPs, VPCs and knowledge bases deserialize.
  • Type identifier fields (id, *_id) as integers instead of floats, so ids serialize as 1873345 rather than 1873345.0.

Regenerated src/apis and src/models accordingly.

🤖 Generated with Claude Code

The upstream OpenAPI spec omits account-status fields the live API
actually returns (login, registered_at, two_factor_method,
is_password_set) and names the SSH-key list property 'ssh-keys' while the
API sends 'ssh_keys'. Both were undocumented upstream defects; the latter
had been hand-patched in the generated file and was lost on regeneration.

Move both fixes into openapi/normalize_spec.py so every regeneration
(manual and the spec-sync CI) re-applies them automatically: add the
missing status fields (defensively, as Option) and rename the ssh-keys
response property to ssh_keys. Regenerated src/models accordingly.
Two more upstream-spec defects made GET /api/v1/apps deserialize to an
empty list (dashboard showed 0 apps despite several existing):

- The 'app' schema marks 'framework', 'branch_name', 'server_id' required,
  but the live API never sends them (it sends 'branch', no 'framework').
  relax_overstrict_required() trims the schema's required list to the
  identifying fields the API reliably returns; the rest become Option.
- 'location' is a closed enum (ru-1/pl-1/nl-1/...) but new zones like
  'de-1' appear over time, failing enum deserialization for the whole
  collection. relax_location_enums() strips the enum from every
  location-like field (keeping type string) so any zone deserializes.

Both live in normalize_spec.py, so they survive every regeneration and the
spec-sync CI. Regenerated src/models accordingly.
Four more tabs deserialized to empty because of upstream-spec drift; all
fixed durably in normalize_spec.py so they survive regeneration:

- relax_open_enums(): generalize the location-enum delisting to also cover
  the database-engine enum (postgres18 etc.) and floating-ip resource_type
  (the API returns 'dbaas', absent from the spec's
  server/balancer/database/network set).
- nullable_vpc_optional_fields(): GET /api/v2/vpcs returns null for
  'description' and 'public_ip'; mark them nullable.
- rename_mismatched_properties(): generalize the ssh-keys rename to also map
  the knowledge-bases response property 'knowledgebases' -> the API's
  'knowledge_bases'.

Regenerated src/models accordingly.
Numeric ids (id, *_id) were typed 'number' in the spec, so the generated
Rust models used f64 and JSON serialized them as floats (1873345.0). Add
an integer_id_fields() normalizer pass that retypes id-like number fields
to integer/int64; genuine decimals (balance, *_cost) keep their type
because their names do not match. Regenerated src/models accordingly.
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@RAprogramm RAprogramm merged commit 37c87bc into main Jun 30, 2026
12 checks passed
@RAprogramm RAprogramm deleted the fix-account-status-login branch June 30, 2026 04:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant