Skip to content

Commit b31841e

Browse files
slachiewiczKehrlann
authored andcommitted
docs(core): document String structuredContent parsing in JsonSchemaValidator
1 parent bb0ca87 commit b31841e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

mcp-core/src/main/java/io/modelcontextprotocol/json/schema/JsonSchemaValidator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ public static ValidationResponse asInvalid(String message) {
5757

5858
/**
5959
* Validates the structured content against the provided JSON schema.
60+
* <p>
61+
* If {@code structuredContent} is a {@link String}, it is treated as a serialized
62+
* JSON document and parsed before validation; quote embedded strings accordingly (for
63+
* example {@code "\"red\""} for the JSON string value {@code red}). Any other type is
64+
* converted to its JSON representation directly.
6065
* @param schema The JSON schema to validate against.
6166
* @param structuredContent The structured content to validate.
6267
* @return A ValidationResponse indicating whether the validation was successful or

0 commit comments

Comments
 (0)