Interface SchemaDefinition
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
SchemaDefinition.Jsii$Proxy
@Generated(value="jsii-pacmak/1.129.0 (build eaca441)",
date="2026-05-19T08:18:44.504Z")
@Stability(Stable)
public interface SchemaDefinition
extends software.amazon.jsii.JsiiSerializable
Schema definition for tool input/output.
Example:
// Create a gateway first
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
.gatewayName("my-gateway")
.build();
Function lambdaFunction = Function.Builder.create(this, "MyFunction")
.runtime(Runtime.NODEJS_22_X)
.handler("index.handler")
.code(Code.fromInline("\n exports.handler = async (event) => {\n return {\n statusCode: 200,\n body: JSON.stringify({ message: 'Hello from Lambda!' })\n };\n };\n "))
.build();
GatewayTarget lambdaTarget = gateway.addLambdaTarget("MyLambdaTarget", AddLambdaTargetOptions.builder()
.gatewayTargetName("my-lambda-target")
.description("Lambda function target")
.lambdaFunction(lambdaFunction)
.toolSchema(ToolSchema.fromInline(List.of(ToolDefinition.builder()
.name("hello_world")
.description("A simple hello world tool")
.inputSchema(SchemaDefinition.builder()
.type(SchemaDefinitionType.OBJECT)
.properties(Map.of(
"name", SchemaDefinition.builder()
.type(SchemaDefinitionType.STRING)
.description("The name to greet")
.build()))
.required(List.of("name"))
.build())
.build())))
.build());
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forSchemaDefinitionstatic final classAn implementation forSchemaDefinition -
Method Summary
Modifier and TypeMethodDescriptionstatic SchemaDefinition.Builderbuilder()default StringThe description of the schema definition.default SchemaDefinitiongetItems()The items in the schema definition.default Map<String, SchemaDefinition> The properties of the schema definition.The required fields in the schema definition.getType()The type of the schema definition.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getType
The type of the schema definition.This field specifies the data type of the schema.
-
getDescription
The description of the schema definition.This description provides information about the purpose and usage of the schema.
Default: - No description
-
getItems
The items in the schema definition.This field is used for array types to define the structure of the array elements.
Default: - No items definition
-
getProperties
The properties of the schema definition.These properties define the fields in the schema.
Default: - No properties
-
getRequired
The required fields in the schema definition.These fields must be provided when using the schema.
Default: - No required fields
-
builder
- Returns:
- a
SchemaDefinition.BuilderofSchemaDefinition
-