Skip to content

Chore: Regenerate components from updated OpenAPI spec#433

Open
nezhyborets wants to merge 9 commits into
mainfrom
chore/regenerate-from-spec
Open

Chore: Regenerate components from updated OpenAPI spec#433
nezhyborets wants to merge 9 commits into
mainfrom
chore/regenerate-from-spec

Conversation

@nezhyborets

@nezhyborets nezhyborets commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

What

  • update the bundled OpenAPI specification and regenerate component schemas (fixes 'in_memory' instead of 'in-memory' for PromptCacheRetentionPayload #430)
  • add a reproducible generation pipeline with documented generator and specification workarounds
  • fix web-search response decoding and cover the affected coding behavior
  • update the contributing guide to describe the current generation workflow

Why

Keep generated schemas aligned with the newer OpenAPI specification while making future regeneration repeatable and reviewable.

Affected Areas

  • OpenAPI specification and generated schemas
  • response streaming and web-search decoding
  • generation scripts and contributor documentation

More Info

The generator-specific prerequisites remain documented in the Makefile. The unrelated local Xcode project change is not included in this branch.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.Schemas from the updated openapi.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 Item decoding (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"
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.

'in_memory' instead of 'in-memory' for PromptCacheRetentionPayload

2 participants