Skip to main content

Class: ExternalDocumentation

protoc_gen_openapiv2.options.ExternalDocumentation

ExternalDocumentation is a representation of OpenAPI v2 specification's ExternalDocumentation object.

See: https://github.com/OAI/OpenAPI-Specification/blob/3.0.0/versions/2.0.md#externalDocumentationObject

Example:

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { ... external_docs: { description: "More about gRPC-Gateway"; url: "https://github.com/grpc-ecosystem/grpc-gateway"; } ... };

Implements

Constructors

constructor

new ExternalDocumentation(properties?): ExternalDocumentation

Constructs a new ExternalDocumentation.

Parameters

NameTypeDescription
properties?IExternalDocumentationProperties to set

Returns

ExternalDocumentation

Properties

description

description: string

A short description of the target documentation. GFM syntax can be used for rich text representation.

Implementation of

IExternalDocumentation.description


url

url: string

The URL for the target documentation. Value MUST be in the format of a URL.

Implementation of

IExternalDocumentation.url

Methods

toJSON

toJSON(): Object

Converts this ExternalDocumentation to JSON.

Returns

Object

JSON object


create

create(properties?): ExternalDocumentation

Creates a new ExternalDocumentation instance using the specified properties.

Parameters

NameTypeDescription
properties?IExternalDocumentationProperties to set

Returns

ExternalDocumentation

ExternalDocumentation instance


decode

decode(reader, length?): ExternalDocumentation

Decodes an ExternalDocumentation message from the specified reader or buffer.

Parameters

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

Returns

ExternalDocumentation

ExternalDocumentation

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): ExternalDocumentation

Decodes an ExternalDocumentation message from the specified reader or buffer, length delimited.

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

ExternalDocumentation

ExternalDocumentation

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 ExternalDocumentation message. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.verify|verify messages.

Parameters

NameTypeDescription
messageIExternalDocumentationExternalDocumentation message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

Encodes the specified ExternalDocumentation message, length delimited. Does not implicitly grpc.gateway.protoc_gen_openapiv2.options.ExternalDocumentation.verify|verify messages.

Parameters

NameTypeDescription
messageIExternalDocumentationExternalDocumentation message or plain object to encode
writer?WriterWriter to encode to

Returns

Writer

Writer


fromObject

fromObject(object): ExternalDocumentation

Creates an ExternalDocumentation message from a plain object. Also converts values to their respective internal types.

Parameters

NameTypeDescription
objectObjectPlain object

Returns

ExternalDocumentation

ExternalDocumentation


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for ExternalDocumentation

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 an ExternalDocumentation message. Also converts values to other types if specified.

Parameters

NameTypeDescription
messageExternalDocumentationExternalDocumentation
options?IConversionOptionsConversion options

Returns

Object

Plain object