Skip to content

fix(openapi): preserve schema instance values during sanitization - #8448

Open
chelsealong wants to merge 1 commit into
google:mainfrom
chelsealong:fix/codex-adk-8447
Open

chelsealong wants to merge 1 commit into
google:mainfrom
chelsealong:fix/codex-adk-8447

Conversation

@chelsealong

Copy link
Copy Markdown
Contributor

Link to Issue or Description of Change

Problem: OpenAPI schema sanitization treats object data in default, enum, and examples as nested schemas, changing or removing their type fields.

Solution: Traverse actual nested-schema keywords when sanitizing types. Preserve instance values exactly while continuing to normalize nested schema types.

Testing Plan

Unit Tests:

  • Added a regression test through OpenApiSpecParser.parse(). It failed before the fix because the parsed default lost "type": "invoice".
  • The parser test file passes: 31 passed.
  • The full tox matrix passes on Python 3.11, 3.12, 3.13, and 3.14.

Manual End-to-End (E2E) Tests:

Ran the issue’s offline parsing reproduction. Both the input and parsed schemas accept the value; the parsed default, enum, and examples retain their original data. Output: input valid: True, parsed valid: True.

Checklist

  • I have read CONTRIBUTING.md.
  • I have reviewed the diff.
  • I have added a test that proves the fix.
  • New and existing unit tests pass locally.
  • I have manually tested the affected parsing flow.

Additional context

Codex assisted with this change.

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.

OpenAPI schema sanitization changes object values in default, enum and examples

1 participant