Class JsonSchemaConverter
java.lang.Object
org.springframework.ai.vertexai.gemini.schema.JsonSchemaConverter
Utility class for converting JSON Schema to OpenAPI schema format.
-
Method Summary
Modifier and TypeMethodDescriptionstatic com.fasterxml.jackson.databind.node.ObjectNode
convertToOpenApiSchema
(com.fasterxml.jackson.databind.node.ObjectNode jsonSchemaNode) Converts a JSON Schema ObjectNode to OpenAPI schema format.static com.fasterxml.jackson.databind.node.ObjectNode
Parses a JSON string into an ObjectNode.
-
Method Details
-
fromJson
Parses a JSON string into an ObjectNode.- Parameters:
jsonString
- The JSON string to parse- Returns:
- ObjectNode containing the parsed JSON
- Throws:
RuntimeException
- if the JSON string cannot be parsed
-
convertToOpenApiSchema
public static com.fasterxml.jackson.databind.node.ObjectNode convertToOpenApiSchema(com.fasterxml.jackson.databind.node.ObjectNode jsonSchemaNode) Converts a JSON Schema ObjectNode to OpenAPI schema format.- Parameters:
jsonSchemaNode
- The input JSON Schema as ObjectNode- Returns:
- ObjectNode containing the OpenAPI schema
- Throws:
IllegalArgumentException
- if jsonSchemaNode is null
-