File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 15
15
* limitations under the License.
16
16
*/
17
17
18
- import { VertexAIError } from '../errors' ;
19
- import { VertexAIErrorCode } from '../types' ;
18
+ import { AIError } from '../errors' ;
19
+ import { AIErrorCode } from '../types' ;
20
20
import {
21
21
SchemaInterface ,
22
22
SchemaType ,
@@ -49,6 +49,12 @@ export abstract class Schema implements SchemaInterface {
49
49
format ?: string ;
50
50
/** Optional. The description of the property. */
51
51
description ?: string ;
52
+ /** Optional. The items of the property. */
53
+ items ?: SchemaInterface ;
54
+ /** The minimum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
55
+ minItems ?: number ;
56
+ /** The maximum number of items (elements) in a schema of type {@link SchemaType.ARRAY}. */
57
+ maxItems ?: number ;
52
58
/** Optional. Whether the property is nullable. Defaults to false. */
53
59
nullable : boolean ;
54
60
/** Optional. The example of the property. */
@@ -257,8 +263,8 @@ export class ObjectSchema extends Schema {
257
263
if ( this . optionalProperties ) {
258
264
for ( const propertyKey of this . optionalProperties ) {
259
265
if ( ! this . properties . hasOwnProperty ( propertyKey ) ) {
260
- throw new VertexAIError (
261
- VertexAIErrorCode . INVALID_SCHEMA ,
266
+ throw new AIError (
267
+ AIErrorCode . INVALID_SCHEMA ,
262
268
`Property "${ propertyKey } " specified in "optionalProperties" does not exist.` ,
263
269
) ;
264
270
}
You can’t perform that action at this time.
0 commit comments