feat(schema): add support for JSON Schema $defs and definitions (#146)

Added support for $defs and definitions properties in JsonSchema record to handle JSON Schema references properly. Added tests to verify both formats work correctly.

The JsonSchema test approach uses serialization/deserialization round-trip validation instead of property-by-property assertions. This makes tests more maintainable and less likely to break when new properties are added.

🤖 Generated with [Claude Code](https://claude.ai/code)

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Richie Caputo 2025-04-23 10:47:48 -04:00 • committed by GitHub
commit f70b98b4b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -703,7 +703,9 @@ public final class McpSchema {
@JsonProperty("type") String type,
@JsonProperty("properties") Map<String, Object> properties,
@JsonProperty("required") List<String> required,
@JsonProperty("additionalProperties") Boolean additionalProperties) {
@JsonProperty("additionalProperties") Boolean additionalProperties,
@JsonProperty("$defs") Map<String, Object> defs,
@JsonProperty("definitions") Map<String, Object> definitions) {
} // @formatter:on
/**