14
14
* See the License for the specific language governing permissions and
15
15
* limitations under the License.
16
16
*/
17
+
17
18
/**
18
19
* Contains the list of OpenAPI data types
19
20
* as defined by the
@@ -36,40 +37,59 @@ export enum SchemaType {
36
37
}
37
38
38
39
/**
39
- * Basic <code> {@link Schema}</code> properties shared across several Schema-related
40
+ * Basic {@link Schema} properties shared across several Schema-related
40
41
* types.
41
42
* @public
42
43
*/
43
44
export interface SchemaShared < T > {
44
- /** Optional. The format of the property. */
45
+ /** Optional. The format of the property.
46
+ * When using the Gemini Developer API ({@link GoogleAIBackend}), this must be either `'enum'` or
47
+ * `'date-time'`, otherwise requests will fail.
48
+ */
45
49
format ?: string ;
46
50
/** Optional. The description of the property. */
47
51
description ?: string ;
52
+ /**
53
+ * The title of the property. This helps document the schema's purpose but does not typically
54
+ * constrain the generated value. It can subtly guide the model by clarifying the intent of a
55
+ * field.
56
+ */
57
+ title ?: string ;
48
58
/** Optional. The items of the property. */
49
59
items ?: T ;
60
+ /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
61
+ minItems ?: number ;
62
+ /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
63
+ maxItems ?: number ;
50
64
/** Optional. Map of `Schema` objects. */
51
65
properties ?: {
52
66
[ k : string ] : T ;
53
67
} ;
68
+ /** A hint suggesting the order in which the keys should appear in the generated JSON string. */
69
+ propertyOrdering ?: string [ ] ;
54
70
/** Optional. The enum of the property. */
55
71
enum ?: string [ ] ;
56
72
/** Optional. The example of the property. */
57
73
example ?: unknown ;
58
74
/** Optional. Whether the property is nullable. */
59
75
nullable ?: boolean ;
76
+ /** The minimum value of a numeric type. */
77
+ minimum ?: number ;
78
+ /** The maximum value of a numeric type. */
79
+ maximum ?: number ;
60
80
[ key : string ] : unknown ;
61
81
}
62
82
63
83
/**
64
- * Params passed to <code> {@link Schema}</code> static methods to create specific
65
- * <code> {@link Schema}</code> classes.
84
+ * Params passed to {@link Schema} static methods to create specific
85
+ * {@link Schema} classes.
66
86
* @public
67
87
*/
68
88
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
69
89
export interface SchemaParams extends SchemaShared < SchemaInterface > { }
70
90
71
91
/**
72
- * Final format for <code> {@link Schema}</code> params passed to backend requests.
92
+ * Final format for {@link Schema} params passed to backend requests.
73
93
* @public
74
94
*/
75
95
export interface SchemaRequest extends SchemaShared < SchemaRequest > {
@@ -83,7 +103,7 @@ export interface SchemaRequest extends SchemaShared<SchemaRequest> {
83
103
}
84
104
85
105
/**
86
- * Interface for <code> {@link Schema}</code> class.
106
+ * Interface for {@link Schema} class.
87
107
* @public
88
108
*/
89
109
export interface SchemaInterface extends SchemaShared < SchemaInterface > {
@@ -95,7 +115,7 @@ export interface SchemaInterface extends SchemaShared<SchemaInterface> {
95
115
}
96
116
97
117
/**
98
- * Interface for <code> {@link ObjectSchema}</code> class.
118
+ * Interface for {@link ObjectSchema} class.
99
119
* @public
100
120
*/
101
121
export interface ObjectSchemaInterface extends SchemaInterface {
0 commit comments