Class SpringAiSchemaModule
java.lang.Object
org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
org.springframework.ai.util.json.schema.SpringAiSchemaModule
- All Implemented Interfaces:
com.github.victools.jsonschema.generator.Module
JSON Schema Generator Module for Spring AI.
This module provides a set of customizations to the JSON Schema generator to support
the Spring AI framework. It allows extracting descriptions from
@ToolParam(description = ...) annotations and to determine whether a property
is required based on the presence of a series of annotations.
- Since:
- 1.0.0
- Author:
- Thomas Vitale
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
AbstractSpringAiSchemaModule.Option -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable StringresolveToolParamDescription(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) Extract the description from the tool-param annotation for the given member, or returnnullif the annotation is absent or its description is blank.protected @Nullable BooleanresolveToolParamRequired(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) Extract the required flag from the tool-param annotation for the given member, or returnnullif the annotation is absent.Methods inherited from class org.springframework.ai.util.json.schema.AbstractSpringAiSchemaModule
applyToConfigBuilder
-
Constructor Details
-
SpringAiSchemaModule
-
-
Method Details
-
resolveToolParamDescription
protected @Nullable String resolveToolParamDescription(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) Description copied from class:AbstractSpringAiSchemaModuleExtract the description from the tool-param annotation for the given member, or returnnullif the annotation is absent or its description is blank.- Specified by:
resolveToolParamDescriptionin classAbstractSpringAiSchemaModule
-
resolveToolParamRequired
protected @Nullable Boolean resolveToolParamRequired(com.github.victools.jsonschema.generator.MemberScope<?, ?> member) Description copied from class:AbstractSpringAiSchemaModuleExtract the required flag from the tool-param annotation for the given member, or returnnullif the annotation is absent.- Specified by:
resolveToolParamRequiredin classAbstractSpringAiSchemaModule
-