fix(openapi): preserve array-form (JSON Schema / OAS 3.1) examples by h3xxit · Pull Request #96 · universal-tool-calling-protocol/python-utcp · GitHub
Skip to content

fix(openapi): preserve array-form (JSON Schema / OAS 3.1) examples#96

Merged
h3xxit merged 3 commits into
mainfrom
dev
Jun 24, 2026
Merged

fix(openapi): preserve array-form (JSON Schema / OAS 3.1) examples#96
h3xxit merged 3 commits into
mainfrom
dev

Conversation

@h3xxit

@h3xxit h3xxit commented Jun 24, 2026

Copy link
Copy Markdown
Member

_extract_examples only handled 'examples' as an OpenAPI map of named Example Objects, while _schema_without_example_keys strips 'examples' from schemas before spreading. So a JSON Schema / OpenAPI 3.1 schema-level 'examples' list was extracted as nothing and then dropped - silent data loss.

Handle the list form too: list entries are literal example values; the map form keeps its Example Object 'value' handling. Adds a test covering array-form schema examples on both request body and response. Bumps utcp-http 1.1.9 -> 1.1.10.


Summary by cubic

Preserves JSON Schema/OpenAPI 3.1 array-form schema examples and makes example de-duplication type-aware and order-insensitive, so request and response examples carry through without losing distinct values.

  • Bug Fixes

    • Support array-form examples on Schema objects (OAS 3.1/JSON Schema).
    • De-duplicate examples via canonical JSON keys; keeps types distinct (e.g., True vs 1) and collapses reordered objects.
    • Tests for array-form examples and the new de-dup behavior on request body and response.
  • Dependencies

    • Bump utcp-http from 1.1.9 to 1.1.11.

Written for commit 89a9832. Summary will update on new commits.

Review in cubic

_extract_examples only handled 'examples' as an OpenAPI map of named Example
Objects, while _schema_without_example_keys strips 'examples' from schemas
before spreading. So a JSON Schema / OpenAPI 3.1 schema-level 'examples' list
was extracted as nothing and then dropped - silent data loss.

Handle the list form too: list entries are literal example values; the map
form keeps its Example Object 'value' handling. Adds a test covering array-form
schema examples on both request body and response. Bumps utcp-http
1.1.9 -> 1.1.10.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 3 files

Re-trigger cubic

h3xxit and others added 2 commits June 24, 2026 23:34
…itive

_merge_examples de-duped with `ex not in merged`, i.e. Python `==`. That
collapses semantically distinct JSON examples: True == 1, False == 0,
1 == 1.0 — so mixing such values silently dropped one. Switch to a canonical
JSON key (json.dumps with sorted keys) for identity: order-insensitive for
objects and type-aware for scalars. Aligns the de-dup behavior with the
TypeScript implementation. Bumps utcp-http 1.1.10 -> 1.1.11.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pi-example-dedup

fix(openapi): type-aware, order-insensitive example de-duplication

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 3 files

Re-trigger cubic

@h3xxit h3xxit merged commit fd30247 into main Jun 24, 2026
19 checks passed
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.

1 participant