Class: Tag
protoc_gen_openapiv2.options.Tag
Tag is a representation of OpenAPI v2 specification's Tag object.
See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#tagObject
Implements
Constructors
constructor
• new Tag(properties?): Tag
Constructs a new Tag.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ITag | Properties to set |
Returns
Properties
description
• description: string
A short description for the tag. GFM syntax can be used for rich text representation.
Implementation of
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]: IValue
Implementation of
externalDocs
• Optional externalDocs: null | IExternalDocumentation
Additional external documentation for this tag.
Implementation of
name
• name: string
The name of the tag. Use it to allow override of the name of a global Tag object, then use that name to reference the tag throughout the OpenAPI file.
Implementation of
Methods
toJSON
▸ toJSON(): Object
Converts this Tag to JSON.
Returns
Object
JSON object
create
▸ create(properties?): Tag
Creates a new Tag instance using the specified properties.
Parameters
| Name | Type | Description |
|---|---|---|
properties? | ITag | Properties to set |
Returns
Tag instance
decode
▸ decode(reader, length?): Tag
Decodes a Tag message from the specified reader or buffer.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
length? | number | Message length if known beforehand |
Returns
Tag
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
decodeDelimited
▸ decodeDelimited(reader): Tag
Decodes a Tag message from the specified reader or buffer, length delimited.
Parameters
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
Tag
Throws
If the payload is not a reader or valid buffer
Throws
If required fields are missing
encode
▸ encode(message, writer?): Writer
Encodes the specified Tag message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.Tag.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | ITag | Tag message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
encodeDelimited
▸ encodeDelimited(message, writer?): Writer
Encodes the specified Tag message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.Tag.verify|verify messages.
Parameters
| Name | Type | Description |
|---|---|---|
message | ITag | Tag message or plain object to encode |
writer? | Writer | Writer to encode to |
Returns
Writer
Writer
fromObject
▸ fromObject(object): Tag
Creates a Tag message from a plain object. Also converts values to their respective internal types.
Parameters
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
Tag
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for Tag
Parameters
| Name | Type | Description |
|---|---|---|
typeUrlPrefix? | string | your custom typeUrlPrefix(default "type.googleapis.com") |
Returns
string
The default type url
toObject
▸ toObject(message, options?): Object
Creates a plain object from a Tag message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | Tag | Tag |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object