Package dev.tachyonmcp.core.server.json
Class JsonSchemaUtils
java.lang.Object
dev.tachyonmcp.core.server.json.JsonSchemaUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable StringvalidateArguments(JsonSchemaValidator validator, @Nullable JsonSchema schema, @Nullable Map<String, tools.jackson.databind.JsonNode> args) Validates args against schema; returns a joined error message, or null when valid / no schema.static voidvalidateSchemaRoot(JsonSchemaFactory<String> factory, String schemaKind, String toolName, @Nullable JsonSchema schema) Validates that a tool schema is well-formed JSON with an object root declaring"type": "object".
-
Method Details
-
validateSchemaRoot
public static void validateSchemaRoot(JsonSchemaFactory<String> factory, String schemaKind, String toolName, @Nullable JsonSchema schema) Validates that a tool schema is well-formed JSON with an object root declaring"type": "object".- Parameters:
factory- parses and validates the schema's raw JSONschemaKind- the kind of schema being validatedtoolName- the name of the tool owning the schemaschema- the schema to validate, ornull- Throws:
IllegalArgumentException- if the schema is not valid JSON, or its root is invalid
-
validateArguments
public static @Nullable String validateArguments(JsonSchemaValidator validator, @Nullable JsonSchema schema, @Nullable Map<String, tools.jackson.databind.JsonNode> args) Validates args against schema; returns a joined error message, or null when valid / no schema.
-