Package io.github.glaforge.gemini.schema
Class StringSchema
java.lang.Object
io.github.glaforge.gemini.schema.Schema
io.github.glaforge.gemini.schema.StringSchema
Schema for String types.
Example usage:
StringSchema schema = new StringSchema()
.format(StringSchema.Format.DATE)
.enumValues("2023-11-01", "2023-11-02");
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPredefined formats for string schemas. -
Field Summary
Fields inherited from class io.github.glaforge.gemini.schema.Schema
description, nullable, title, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionenumValues(String... values) Define the allowed enum values for this string.format(StringSchema.Format format) Define the format of the string using a predefined enum.Define the format of the string (e.g., "date-time").toMap()Convert this Schema object into a Map suitable for JSON serialization.
-
Constructor Details
-
StringSchema
public StringSchema()Initializes a new string schema.
-
-
Method Details
-
enumValues
Define the allowed enum values for this string.- Parameters:
values- The allowed string values.- Returns:
- The StringSchema instance.
-
format
Define the format of the string (e.g., "date-time").- Parameters:
format- The format string.- Returns:
- The StringSchema instance.
-
format
Define the format of the string using a predefined enum.- Parameters:
format- The format enum.- Returns:
- The StringSchema instance.
-
toMap
Description copied from class:SchemaConvert this Schema object into a Map suitable for JSON serialization.
-