Update to new OpenAI OpenAPI spec#418
Closed
nezhyborets wants to merge 8 commits into
Closed
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove 32 invalid redeclarations: duplicate primitive typealiases (Bool/String/Int/Double = Swift.X) within the same struct scope, and six `typealias String = [Swift.String]` entries that shadowed Swift.String in CodingKeys raw type position, breaking compilation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename reasoning event types: ResponseReasoningDelta/DoneEvent → ResponseReasoningTextDelta/DoneEvent; ResponseReasoningSummaryDelta/DoneEvent → ResponseReasoningSummaryTextDelta/DoneEvent - Reorder decoder chain to match new value indices (value29–50): new ReasoningText events inserted at 29/30 pushed Refusal, OutputText, WebSearch, ImageGen, MCP events down by 2; MCP call-arguments events moved from value40/41 to value42/43, freeing 40/41 for the two previously-missing ImageGen events - Add decoder entries for value40/41 (ImageGenCallInProgress/PartialImage) and value49 (MCPListToolsInProgress), which were absent in the old mapping - Update guard indices to match: value40/41 → value42/43, value49 → value51 - Update case comments to match spec wording Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Generated OutputItem changed from a OneOf struct (value1…value12) to a discriminated enum with named cases. Rewrite init(from:) to decode the generated enum and switch on its cases. Also adds the 13 new cases introduced in the spec: functionToolCallOutputResource, computerToolCallOutputResource, toolSearchCall, toolSearchOutput, compactionBody, localShellToolCallOutput, functionShellCall, functionShellCallOutput, applyPatchToolCall, applyPatchToolCallOutput, mcpApprovalResponseResource, customToolCall, customToolCallOutputResource. Updates existing comments to use absolute URLs and aligns wording with the spec descriptions. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The generated type now has readable case names, making the facade unnecessary. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename Includable → IncludeEnum, TextPayload → ResponseTextParam, ToolChoicePayload → ToolChoiceParam - Replace LocalShellTool → LocalShellToolParam in Tool enum - Add new Tool cases: computer, computerUsePreview, webSearch, webSearchPreview, functionShell, custom, namespace, toolSearch, applyPatch - Drop Tool suffix from all enum case names Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Restore Tool suffix on all enum cases; rename codeInterpreter → codeInterpreterTool - Add required responseId param to ResponseAudioDoneEvent in test - Add logprobs:[] to mock SSE JSON for ResponseTextDeltaEvent (now required by spec) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Components.swiftfrom the latest OpenAI OpenAPI specResponseStreamEventandOutputItemfor new schema shapesIncludable→IncludeEnum,TextPayload→ResponseTextParam,ToolChoicePayload→ToolChoiceParamLocalShellTool→LocalShellToolParam; add newToolcases:computerTool,computerUsePreviewTool,webSearchTool,webSearchPreviewTool,functionShellTool,customTool,namespaceTool,toolSearchTool,applyPatchToolcodeInterpreter→codeInterpreterToolfor consistencyresponseIdonResponseAudioDoneEvent,logprobsonResponseTextDeltaEvent)Test plan
swift buildpasses with no errorsswift test— all tests pass🤖 Generated with Claude Code