Skip to content

Conversation

@jba
Copy link
Contributor

@jba jba commented Jul 18, 2025

Add ForLax[T], which ignores invalid types in schema inference instead of returning an error.

This allows additional customization of a schema after inference does what it can.

For example, an interface type where all the possible implementations are known can be described with "oneof".

For #136.

jba added 2 commits July 18, 2025 12:00
Ignore invalid types in schema inference instead of returning an error.

This allows additional customization of a schema after inference does
what it can.

For example, an interface type where all the possible implementations
are known can be described with "oneof".

For modelcontextprotocol#136.
@jba jba requested review from findleyr and samthanawalla July 18, 2025 16:56
// ForLax behaves like [For], except that it ignores struct fields with invalid types instead of
// returning an error. That allows callers to adjust the resulting schema using custom knowledge.
// For example, an interface type where all the possible implementations are known
// can be described with "oneof".

Choose a reason for hiding this comment

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

I like choices
freedom

@jba jba merged commit c6fabbb into modelcontextprotocol:main Jul 21, 2025
3 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.

3 participants