Package dev.tachyonmcp.api.json
Interface JsonSchema
- All Superinterfaces:
JsonDocument
An immutable, encoded JSON Schema.
Both object and boolean schemas are supported. The server validates the schema against its declared dialect, or JSON Schema 2020-12 when the dialect is absent.
- Author:
- Konstantin Pavlov
-
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> JsonSchemaCreates a schema from an already-parsed representation, via theJsonSchemaFactorydiscovered throughServiceLoaderfortype.static JsonSchemaReturns a schema that accepts any JSON object.static JsonSchemaCreates a schema from encoded JSON.static JsonSchemaCreates a schema from encoded JSON, validating it via theJsonSchemaFactorydiscovered throughServiceLoaderforString.Methods inherited from interface dev.tachyonmcp.api.json.JsonDocument
json, unwrap
-
Method Details
-
objectSchema
Returns a schema that accepts any JSON object. -
of
Creates a schema from encoded JSON. -
parse
Creates a schema from encoded JSON, validating it via theJsonSchemaFactorydiscovered throughServiceLoaderforString.- Parameters:
json- the JSON string- Returns:
- the parsed schema
- Throws:
IllegalArgumentException- ifjsonis not valid JSONIllegalStateException- if noJsonSchemaFactory<String>is registered
-
from
Creates a schema from an already-parsed representation, via theJsonSchemaFactorydiscovered throughServiceLoaderfortype.- Parameters:
source- the source representation, e.g. a JacksonJsonNodetype- the source representation's type- Returns:
- the parsed schema
- Throws:
IllegalStateException- if noJsonSchemaFactory<T>is registered fortype
-