Class JsonSchema
java.lang.Object
org.apache.juneau.bean.mcp.v20250618.JsonSchema
JSON Schema subset used by MCP tool
inputSchema objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddDef(String name, JsonSchema value) Convenience method to add a single reusable sub-schema.addProperty(String name, JsonSchema value) Convenience method to add a single property schema.addRequired(String... value) Appends to the required property names.addRequired(Collection<String> value) Appends to the required property names.additionalPropertieskeyword (boolean or nested schema).getDefs()$defsmap for reusable sub-schemas.getItems()Arrayitemsschema.Object property schemas.Required property names.getType()Schematypekeyword (for exampleobject).setAdditionalProperties(Object value) SetsadditionalProperties.setDefs(Map<String, JsonSchema> value) Sets$defs.setItems(JsonSchema value) Sets array items schema.setProperties(Map<String, JsonSchema> value) Sets object property schemas.setRequired(String... value) Sets required property names.setRequired(List<String> value) Sets required property names.Sets the schema type keyword.
-
Constructor Details
-
JsonSchema
public JsonSchema()
-
-
Method Details
-
getType
Schematypekeyword (for exampleobject).- Returns:
- The type, or
nullif not set.
-
setType
Sets the schema type keyword.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getProperties
Object property schemas.- Returns:
- The properties map, or
nullif not set.
-
setProperties
Sets object property schemas.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
addProperty
Convenience method to add a single property schema.- Parameters:
name- The property name. Can benull (LinkedHashMaptolerates anull key).value- The property schema. Can benull (stored asnull ).- Returns:
- This object (for method chaining).
-
getRequired
Required property names.- Returns:
- The required list, or
nullif not set.
-
setRequired
Sets required property names.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
setRequired
Sets required property names.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
addRequired
Appends to the required property names.- Parameters:
value- The values to append.- Returns:
- This object (for method chaining).
-
addRequired
Appends to the required property names.- Parameters:
value- The values to append.- Returns:
- This object (for method chaining).
-
getAdditionalProperties
additionalPropertieskeyword (boolean or nested schema).- Returns:
- The value, or
nullif not set.
-
setAdditionalProperties
SetsadditionalProperties.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getItems
Arrayitemsschema.- Returns:
- The items schema, or
nullif not set.
-
setItems
Sets array items schema.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
getDefs
$defsmap for reusable sub-schemas.- Returns:
- The defs map, or
nullif not set.
-
setDefs
Sets$defs.- Parameters:
value- The new value. Can benull to unset the property.- Returns:
- This object (for method chaining).
-
addDef
Convenience method to add a single reusable sub-schema.- Parameters:
name- The sub-schema name. Can benull (LinkedHashMaptolerates anull key).value- The sub-schema. Can benull (stored asnull ).- Returns:
- This object (for method chaining).
-