Skip to content

Commit 2f17c17

Browse files
committed
More fixes to doc comments
1 parent b79a7e2 commit 2f17c17

File tree

3 files changed

+32
-26
lines changed

3 files changed

+32
-26
lines changed

common/api-review/vertexai-preview.api.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,8 @@ export class ArraySchema extends Schema {
1414
constructor(schemaParams: SchemaParams, items: TypedSchema);
1515
// (undocumented)
1616
items: TypedSchema;
17-
// Warning: (ae-incompatible-release-tags) The symbol "toRequest" is marked as @public, but its signature references "_SchemaRequest" which is marked as @internal
18-
//
19-
// (undocumented)
20-
toRequest(): _SchemaRequest;
17+
// @internal (undocumented)
18+
_toRequest(): _SchemaRequest;
2119
}
2220

2321
// @public
@@ -493,10 +491,8 @@ export class ObjectSchema extends Schema {
493491
properties: {
494492
[k: string]: TypedSchema;
495493
};
496-
// Warning: (ae-incompatible-release-tags) The symbol "toRequest" is marked as @public, but its signature references "_SchemaRequest" which is marked as @internal
497-
//
498-
// (undocumented)
499-
toRequest(): _SchemaRequest;
494+
// @internal (undocumented)
495+
_toRequest(): _SchemaRequest;
500496
}
501497

502498
// @public
@@ -606,8 +602,8 @@ export abstract class Schema implements SchemaInterface {
606602
static string(stringParams?: SchemaParams): StringSchema;
607603
// (undocumented)
608604
toJSON(): string;
609-
// Warning: (ae-incompatible-release-tags) The symbol "toRequest" is marked as @public, but its signature references "_SchemaRequest" which is marked as @internal
610-
toRequest(): _SchemaRequest;
605+
// Warning: (ae-incompatible-release-tags) The symbol "_toRequest" is marked as @public, but its signature references "_SchemaRequest" which is marked as @internal
606+
_toRequest(): _SchemaRequest;
611607
type: SchemaType;
612608
}
613609

@@ -665,10 +661,8 @@ export class StringSchema extends Schema {
665661
constructor(schemaParams?: SchemaParams, enumValues?: string[]);
666662
// (undocumented)
667663
enum?: string[];
668-
// Warning: (ae-incompatible-release-tags) The symbol "toRequest" is marked as @public, but its signature references "_SchemaRequest" which is marked as @internal
669-
//
670-
// (undocumented)
671-
toRequest(): _SchemaRequest;
664+
// @internal (undocumented)
665+
_toRequest(): _SchemaRequest;
672666
}
673667

674668
// @public

packages/vertexai/src/requests/schema-builder.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@ export abstract class Schema implements SchemaInterface {
5252
: false;
5353
}
5454

55-
/** Converts class to a plain JSON object (not a string). */
56-
toRequest(): _SchemaRequest {
55+
/**
56+
* Converts class to a plain JSON object (not a string).
57+
* @internal
58+
*/
59+
_toRequest(): _SchemaRequest {
5760
const obj: { type: SchemaType; [key: string]: unknown } = {
5861
type: this.type
5962
};
@@ -68,7 +71,7 @@ export abstract class Schema implements SchemaInterface {
6871
}
6972

7073
toJSON(): string {
71-
return JSON.stringify(this.toRequest());
74+
return JSON.stringify(this._toRequest());
7275
}
7376

7477
static array(arrayParams: SchemaParams & { items: Schema }): ArraySchema {
@@ -193,8 +196,11 @@ export class StringSchema extends Schema {
193196
this.enum = enumValues;
194197
}
195198

196-
toRequest(): _SchemaRequest {
197-
const obj = super.toRequest();
199+
/**
200+
* @internal
201+
*/
202+
_toRequest(): _SchemaRequest {
203+
const obj = super._toRequest();
198204
if (this.enum) {
199205
obj['enum'] = this.enum;
200206
}
@@ -216,9 +222,12 @@ export class ArraySchema extends Schema {
216222
});
217223
}
218224

219-
toRequest(): _SchemaRequest {
220-
const obj = super.toRequest();
221-
obj.items = this.items.toRequest();
225+
/**
226+
* @internal
227+
*/
228+
_toRequest(): _SchemaRequest {
229+
const obj = super._toRequest();
230+
obj.items = this.items._toRequest();
222231
return obj;
223232
}
224233
}
@@ -242,8 +251,11 @@ export class ObjectSchema extends Schema {
242251
});
243252
}
244253

245-
toRequest(): _SchemaRequest {
246-
const obj = super.toRequest();
254+
/**
255+
* @internal
256+
*/
257+
_toRequest(): _SchemaRequest {
258+
const obj = super._toRequest();
247259
obj.properties = this.properties;
248260
const required = [];
249261
if (this.optionalProperties) {
@@ -260,7 +272,7 @@ export class ObjectSchema extends Schema {
260272
if (this.properties.hasOwnProperty(propertyKey)) {
261273
obj.properties[propertyKey] = this.properties[
262274
propertyKey
263-
].toRequest() as _SchemaRequest;
275+
]._toRequest() as _SchemaRequest;
264276
if (!this.optionalProperties.includes(propertyKey)) {
265277
required.push(propertyKey);
266278
}

packages/vertexai/src/types/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export enum SchemaType {
1818
OBJECT = 'object'
1919
}
2020

21-
interface SchemaShared<T> {
21+
export interface SchemaShared<T> {
2222
/** Optional. The format of the property. */
2323
format?: string;
2424
/** Optional. The description of the property. */

0 commit comments

Comments
 (0)