Sync OpenAPI spec with upstream fixes, remove overlay#9
Merged
Conversation
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.
Collaborator
Author
|
Correction on nullable fields: After testing against the real API, So the upstream fix in QTPF-8308 should only add Also saw your PR for the |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Backend.degradedremoved from required@nullableannotations, replacedOmit/Pickutility types with inheritance, removedOptional_*wrapper schemasWhat changed in the client
openapi-overlay.yamldeleted (was 155 lines / 22 actions)JobandPick_BaseJob.Exclude_keyofBaseJob.child_job_ids__schemas replaced byBaseJobOptional_string_,Optional_IsoTimestamp_,Optional_number_schemas removed (nullable inlined)Gate_QisGate_->Gate_QisGate,Gate_NativeGate_->Gate_NativeGateTest fixtures updated
test_pagination.pyandtest_polling.pyfixtures now include all required nullable fields matching real API responses.test_models.pyupdated forBaseJobrename.Test plan
uv run pytest- 234 passed, 100% coverageuv run ruff check- all passeduv run ty check ionq_core/- all passedget_whoamiget_backends/get_backend(includingqpu.forte-enterprise-1which lacksdegraded)get_characterizations_for_backendget_jobs- all 22 required fields deserialize, null handling verifiediter_jobspaginationcreate_job+get_job+delete_jobget_job_cost(simulator and QPU)get_job_probabilities(simulator and QPU)wait_for_jobon completed job