Chore: Regenerate components from updated OpenAPI spec#433
Open
nezhyborets wants to merge 9 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the bundled OpenAPI specification and regenerates the Swift component schemas to match it, while adding a repeatable, documented generation pipeline and addressing decoding issues around web-search and response streaming.
Changes:
- Regenerated
Components.Schemasfrom the updatedopenapi.yaml, including recursion handling and several schema shape/type updates. - Added a reproducible OpenAPI preparation pipeline (Python scripts +
make generate) with narrowly scoped spec workarounds. - Improved decoding coverage with new tests for
Itemdecoding (including web-search cases), and adjusted streaming tests for updated event schemas.
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/OpenAITests/StreamingClientTests.swift | Updates streaming test fixture to match regenerated audio event schema. |
| Tests/OpenAITests/ItemCodingTests.swift | Adds tests for Item decoding (message/input vs message/output, and web-search action decoding). |
| Sources/OpenAI/Public/Schemas/Generated/Components.swift | Regenerated schemas (notably recursive CompoundFilter, updated discriminators, updated enums/field types). |
| Sources/OpenAI/Private/Streaming/ModelResponseEventsStreamInterpreter.swift | Adds decode-failure diagnostics around event decoding. |
| Scripts/remove_unsupported_webhooks.py | Removes top-level webhooks from prepared spec to avoid generator filtering/validation issues. |
| Scripts/remove_required_properties.py | Strictly removes selected required entries to align decoding with real API behavior / generator quirks. |
| Scripts/prepare_openapi.py | Orchestrates the ordered OpenAPI preparation pipeline and optional diff output. |
| Scripts/fix_rounded_int64_bounds.py | Normalizes rounded Int64 bounds that otherwise break YAML parsing/generator validation. |
| Scripts/fix_recursive_reference.py | Replaces unsupported $recursiveRef with an equivalent component $ref for CompoundFilter. |
| Scripts/fix_boolean_exclusive_minimum.py | Converts OpenAPI 3.0 boolean exclusiveMinimum syntax into OpenAPI 3.1 numeric form. |
| Makefile | Defines the full reproducible generation pipeline (prepare spec, apply required removals, generate, extract components). |
| Demo/DemoChat/Sources/ResponsesStore.swift | Adjusts demo handling for function tool calls and non-streaming web-search tool calls. |
| CONTRIBUTING.md | Updates contributor documentation to describe the current generation workflow and constraints. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+71
to
+77
| do { | ||
| let responseStreamEvent = try responseStreamEvent(modelResponseEventType: modelResponseEventType, data: event.data) | ||
| onEventDispatched?(responseStreamEvent) | ||
| } catch { | ||
| print("Decoding failed for modelResponseEventType: \(modelResponseEventType), String(data: event.data, encoding: .utf8): \(String(data: event.data, encoding: .utf8))") | ||
| throw error | ||
| } |
Comment on lines
4927
to
4929
| @frozen public enum PromptCacheRetentionPayload: String, Codable, Hashable, Sendable, CaseIterable { | ||
| case inMemory = "in-memory" | ||
| case inMemory = "in_memory" | ||
| case _24h = "24h" |
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.
What
Why
Keep generated schemas aligned with the newer OpenAPI specification while making future regeneration repeatable and reviewable.
Affected Areas
More Info
The generator-specific prerequisites remain documented in the Makefile. The unrelated local Xcode project change is not included in this branch.