Method | Modifiers | Description |
---|---|---|
array(arrayParams) | static | |
boolean(booleanParams) | static | |
enumString(stringParams) | static | |
integer(integerParams) | static | |
number(numberParams) | static | |
object(objectParams) | static | |
string(stringParams) | static |
Constructs a new instance of the Schema
class
Signature:
constructor(schemaParams:SchemaInterface);
Parameter | Type | Description |
---|---|---|
schemaParams | SchemaInterface |
Optional. The description of the property.
Signature:
description?:string;
Optional. The example of the property.
Signature:
example?:unknown;
Optional. The format of the property. Supported formats:
Signature:
format?:string;
Optional. Whether the property is nullable. Defaults to false.
Signature:
nullable:boolean;
Optional. The type of the property. SchemaType.
Signature:
type:SchemaType;
Signature:
staticarray(arrayParams:SchemaParams & {items:Schema;}):ArraySchema;
Parameter | Type | Description |
---|---|---|
arrayParams | SchemaParams & { items: Schema; } |
Returns:
Signature:
staticboolean(booleanParams?:SchemaParams):BooleanSchema;
Parameter | Type | Description |
---|---|---|
booleanParams | SchemaParams |
Returns:
Signature:
staticenumString(stringParams:SchemaParams & {enum:string[];}):StringSchema;
Parameter | Type | Description |
---|---|---|
stringParams | SchemaParams & { enum: string[]; } |
Returns:
Signature:
staticinteger(integerParams?:SchemaParams):IntegerSchema;
Parameter | Type | Description |
---|---|---|
integerParams | SchemaParams |
Returns:
Signature:
staticnumber(numberParams?:SchemaParams):NumberSchema;
Parameter | Type | Description |
---|---|---|
numberParams | SchemaParams |
Returns:
Signature:
staticobject(objectParams:SchemaParams & {properties:{[k:string]:Schema;};optionalProperties?:string[];}):ObjectSchema;
Parameter | Type | Description |
---|---|---|
objectParams | SchemaParams & { properties: { [k: string]: Schema; }; optionalProperties?: string[]; } |
Returns:
Signature:
staticstring(stringParams?:SchemaParams):StringSchema;
Parameter | Type | Description |
---|---|---|
stringParams | SchemaParams |
Returns:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-22 UTC.