Class: EnumSchema
EnumSchema is subset of fields from the OpenAPI v2 specification's Schema object.
Only fields that are applicable to Enums are included
See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#schemaObject
Example:
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_enum) = { ... title: "MyEnum"; description:"This is my nice enum"; example: "ZERO"; required: true; ... };
Properties
default
default:
string
EnumSchema default.
description
description:
string
A short description of the schema.
example
example:
string
EnumSchema example.
extensions
extensions:
object
Custom properties that start with "x-" such as "x-foo" used to describe extra functionality that is not covered by the standard OpenAPI Specification. See: https://swagger.io/docs/specification/2-0/swagger-extensions/
Index Signature
[k: string]: $Properties
externalDocs?
optionalexternalDocs?:$Properties|null
Additional external documentation for this schema.
readOnly
readOnly:
boolean
EnumSchema readOnly.
ref
ref:
string
Ref is used to define an external reference to include in the message.
This could be a fully qualified proto message reference, and that type must
be imported into the protofile. If no message is identified, the Ref will
be used verbatim in the output.
For example:
ref: ".google.protobuf.Timestamp".
required
required:
boolean
EnumSchema required.
title
title:
string
The title of the schema.
Methods
toJSON()
toJSON():
object
Converts this EnumSchema to JSON.
Returns
object
JSON object
create()
Call Signature
staticcreate(properties?):EnumSchema&$Shape
Creates a new EnumSchema instance using the specified properties.
Parameters
properties?
Properties to set
Returns
EnumSchema & $Shape
EnumSchema instance
Call Signature
staticcreate(properties?):EnumSchema
Creates a new EnumSchema instance using the specified properties.
Parameters
properties?
Properties to set
Returns
EnumSchema
EnumSchema instance
decode()
staticdecode(reader,length?):EnumSchema&$Shape
Decodes an EnumSchema message from the specified reader or buffer.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
length?
number
Message length if known beforehand
Returns
EnumSchema & $Shape
EnumSchema
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited()
staticdecodeDelimited(reader):EnumSchema&$Shape
Decodes an EnumSchema message from the specified reader or buffer, length delimited.
Parameters
reader
Uint8Array<ArrayBufferLike> | Reader
Reader or buffer to decode from
Returns
EnumSchema & $Shape
EnumSchema
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode()
staticencode(message,writer?):Writer
Encodes the specified EnumSchema message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.EnumSchema.verify|verify messages.
Parameters
message
EnumSchema message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
encodeDelimited()
staticencodeDelimited(message,writer?):Writer
Encodes the specified EnumSchema message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.EnumSchema.verify|verify messages.
Parameters
message
EnumSchema message or plain object to encode
writer?
Writer
Writer to encode to
Returns
Writer
Writer
fromObject()
staticfromObject(object):EnumSchema
Creates an EnumSchema message from a plain object. Also converts values to their respective internal types.
Parameters
object
{[k: string]: any; }
Plain object
Returns
EnumSchema
EnumSchema
toObject()
statictoObject(message,options?):object
Creates a plain object from an EnumSchema message. Also converts values to other types if specified.
Parameters
message
EnumSchema
EnumSchema
options?
IConversionOptions
Conversion options
Returns
object
Plain object