Skip to content

test(strict-schema): cover default removal in referenced schemas - #4808

Open
harshitethic wants to merge 1 commit into
openai:mainfrom
harshitethic:fix/strict-schema-remove-defaults
Open

test(strict-schema): cover default removal in referenced schemas#4808
harshitethic wants to merge 1 commit into
openai:mainfrom
harshitethic:fix/strict-schema-remove-defaults

Conversation

@harshitethic

Copy link
Copy Markdown

What

Add focused regression coverage for strict-schema normalization when a $defs schema contains a default: None value and is referenced by a property.

Why

ensure_strict_json_schema() recursively normalizes definition maps as well as referenced properties. This test locks down the existing behavior that default: None is removed from the referenced definition while the property-level $ref remains intact.

This is intentionally test-only: it does not change runtime behavior.

Testing

The new test exercises the public ensure_strict_json_schema() helper and checks both the normalized $defs entry and the preserved $ref.

Related context: #4390 discusses strict-schema default handling for non-null defaults; this PR does not attempt to change that behavior.

@sylvesterkaczmarek sylvesterkaczmarek 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.

This hits the right boundary. $defs is normalized recursively, so the default: None removal is exercised in the referenced definition while the property stays a plain $ref. Focused regression and no runtime change; I don't see an issue with it.

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.

2 participants