Skip to content

Sync OpenAPI spec with upstream fixes, remove overlay#9

Merged
splch merged 6 commits into
mainfrom
feat/overlay-required-fields
Apr 20, 2026
Merged

Sync OpenAPI spec with upstream fixes, remove overlay#9
splch merged 6 commits into
mainfrom
feat/overlay-required-fields

Conversation

@splch
Copy link
Copy Markdown
Collaborator

@splch splch commented Apr 17, 2026

Summary

Regenerates the client from the production spec at api.ionq.co/v0.4, which now includes all the upstream fixes from Xiaoyun's team. The overlay file is deleted - the spec matches the API exactly.

Upstream fixes incorporated

  • ion-queue#1406: removed overly-restrictive enums on Backend/Characterization/JobBackends
  • ion-queue#1410: Backend.degraded removed from required
  • cloud-job-manager#980: nullable fields on BaseJob/GetCircuitJobResponse using proper tsoa @nullable annotations, replaced Omit/Pick utility types with inheritance, removed Optional_* wrapper schemas
  • ionq/api#1148: synced production spec from GCS

What changed in the client

  • openapi-overlay.yaml deleted (was 155 lines / 22 actions)
  • Job and Pick_BaseJob.Exclude_keyofBaseJob.child_job_ids__ schemas replaced by BaseJob
  • Optional_string_, Optional_IsoTimestamp_, Optional_number_ schemas removed (nullable inlined)
  • Gate schemas renamed: Gate_QisGate_ -> Gate_QisGate, Gate_NativeGate_ -> Gate_NativeGate
  • 3 new endpoints: variant results (histogram, probabilities, shots)
  • Generator config simplified to just gate class name overrides

Test fixtures updated

test_pagination.py and test_polling.py fixtures now include all required nullable fields matching real API responses. test_models.py updated for BaseJob rename.

Test plan

  • uv run pytest - 234 passed, 100% coverage
  • uv run ruff check - all passed
  • uv run ty check ionq_core/ - all passed
  • E2E: get_whoami
  • E2E: get_backends / get_backend (including qpu.forte-enterprise-1 which lacks degraded)
  • E2E: get_characterizations_for_backend
  • E2E: get_jobs - all 22 required fields deserialize, null handling verified
  • E2E: iter_jobs pagination
  • E2E: create_job + get_job + delete_job
  • E2E: get_job_cost (simulator and QPU)
  • E2E: get_job_probabilities (simulator and QPU)
  • E2E: wait_for_job on completed job
  • E2E: QPU job (qpu.forte-1) - metadata, cost ($168.20), execution_duration_ms, probability distribution all deserialize correctly

splch added 2 commits April 17, 2026 07:34
Vendor the updated spec from the ionq/api sync PR which includes
Xiaoyun's upstream fixes: enum restrictions removed, gate schema
field names corrected (type->gate), expanded Job required fields,
results/probabilities endpoint added natively, and three new variant
result endpoints.

The overlay shrinks from 155 lines (22 actions) to 111 lines (25
actions), now covering only nullable field mismatches that remain
in the upstream spec:
- JsonObject, Failure, JobMetadata schemas: nullable
- Job/BaseJobSummary: 10 nullable primitive fields each
- GetCircuitJobResponse: settings/stats allOf+nullable
- Backend.degraded: removed from required (not all backends return it)

Generator config updated for renamed Gate schemas (Gate_QisGate_ ->
Gate_QisGate) and removed overrides for deleted Optional_* schemas.

Test fixtures updated to include newly-required nullable fields.
Verified end-to-end against production API.
Remove JsonObject nullable (output/settings/stats are always {},
never null) and GetCircuitJobResponse settings/stats nullable.
Only results, failure, and metadata are actually null in the API.

Test fixtures corrected to match real API: output/settings/stats
use {} instead of null.
@splch
Copy link
Copy Markdown
Collaborator Author

splch commented Apr 17, 2026

Correction on nullable fields: After testing against the real API, output, settings, and stats are not nullable - they always return {}, even for jobs that haven't completed yet. Only failure, metadata, and results are actually null when absent.

So the upstream fix in QTPF-8308 should only add nullable: true to failure, metadata, and results on the Job/BaseJob schemas - not to output/settings/stats. The overlay here reflects this.

Also saw your PR for the degraded fix (ion-queue#1410) - nice, that'll knock another item off the overlay.

splch added 4 commits April 17, 2026 08:56
JobMetadata is used in creation payloads where null is invalid.
Move the nullable treatment to allOf+nullable on the response
properties (Job.metadata, BaseJobSummary.metadata) instead of
making the schema itself nullable.
Incorporate Xiaoyun's nullable fixes from CJM PR #980 which adds
proper nullable annotations to BaseJob fields using tsoa @nullable
jsdoc instead of Omit/Pick utility types.

The overlay now contains only Backend.degraded (ion-queue#1410).

- Job and Pick_BaseJob schemas replaced by BaseJob
- Optional_string_ removed (inline nullable used instead)
- project_id, parent_job_id, session_id, name: nullable in spec
- metadata, failure, results: allOf+nullable in spec
- started_at, completed_at: Optional_IsoTimestamp_ ref
- predicted/execution durations: Optional_number_ ref
- Generator config: removed Pick_BaseJob and Optional_string_ overrides
Xiaoyun replaced Optional_IsoTimestamp_ and Optional_number_ with
inline allOf+nullable and nullable integer annotations directly on
the fields. Generator config simplified to just gate class overrides.
All upstream fixes have landed in production (api.ionq.co/v0.4):
- CJM#980: nullable fields on BaseJob/GetCircuitJobResponse
- ion-queue#1406: enum restrictions removed
- ion-queue#1410: Backend.degraded optional
- ionq/api#1148: spec synced from GCS

The overlay file is no longer needed. Client regenerated directly
from the production spec without any patches.
Copy link
Copy Markdown

@xiaoyunyang xiaoyunyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing!

@splch splch changed the title Sync spec with ionq/api#1146, expand required fields, minimize overlay Sync OpenAPI spec with upstream fixes, remove overlay Apr 20, 2026
@splch splch merged commit 250fb97 into main Apr 20, 2026
7 checks passed
@splch splch deleted the feat/overlay-required-fields branch April 20, 2026 22:43
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.

2 participants