Skip to content

fix: Support overriding $defs / definition#5115

Closed
reteps wants to merge 2 commits intocolinhacks:mainfrom
reteps:reteps/override-def-schemas
Closed

fix: Support overriding $defs / definition#5115
reteps wants to merge 2 commits intocolinhacks:mainfrom
reteps:reteps/override-def-schemas

Conversation

@reteps
Copy link
Copy Markdown

@reteps reteps commented Aug 19, 2025

Closes #5103

The previous behavior had this logic:

  • If schema has parent, override isn’t called on child schema
  • A .describe or .meta will set a parent

However, this logic considers the concept of a parent based on the Zod schema; which in certain cases makes it impossible to override a schema with no parent in the outputted JSON Schema. This is a bug fix to support overriding schemas at the root level. An alternative fix would be smarter detection of what counts as a parent schema: considering the concept of 'parent' in a JSON Schema $ref as well.

@reteps
Copy link
Copy Markdown
Author

reteps commented Aug 22, 2025

Related: #4622 #5533

@colinhacks
Copy link
Copy Markdown
Owner

Fixed in #5578 👍

@colinhacks colinhacks closed this Apr 30, 2026
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.

Override isn't called in all instances of the schema

2 participants