Skip to main content

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

NameTypeDescription
properties?ITagProperties to set

Returns

Tag

Properties

description

description: string

A short description for the tag. GFM syntax can be used for rich text representation.

Implementation of

ITag.description


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

ITag.extensions


externalDocs

Optional externalDocs: null | IExternalDocumentation

Additional external documentation for this tag.

Implementation of

ITag.externalDocs


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

ITag.name

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

NameTypeDescription
properties?ITagProperties to set

Returns

Tag

Tag instance


decode

decode(reader, length?): Tag

Decodes a Tag message from the specified reader or buffer.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from
length?numberMessage length if known beforehand

Returns

Tag

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

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Tag

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

NameTypeDescription
messageITagTag message or plain object to encode
writer?WriterWriter 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

NameTypeDescription
messageITagTag message or plain object to encode
writer?WriterWriter 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

NameTypeDescription
objectObjectPlain object

Returns

Tag

Tag


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Tag

Parameters

NameTypeDescription
typeUrlPrefix?stringyour 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

NameTypeDescription
messageTagTag
options?IConversionOptionsConversion options

Returns

Object

Plain object