Skip to main content

Class: Info

protoc_gen_openapiv2.options.Info

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

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

Example:

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = { info: { title: "Echo API"; version: "1.0"; description: ""; contact: { name: "gRPC-Gateway project"; url: "https://github.com/grpc-ecosystem/grpc-gateway"; email: "none@example.com"; }; license: { name: "BSD 3-Clause License"; url: "https://github.com/grpc-ecosystem/grpc-gateway/blob/main/LICENSE"; }; }; ... };

Implements

Constructors

constructor

new Info(properties?): Info

Constructs a new Info.

Parameters

NameTypeDescription
properties?IInfoProperties to set

Returns

Info

Properties

contact

Optional contact: null | IContact

The contact information for the exposed API.

Implementation of

IInfo.contact


description

description: string

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

Implementation of

IInfo.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

IInfo.extensions


license

Optional license: null | ILicense

The license information for the exposed API.

Implementation of

IInfo.license


termsOfService

termsOfService: string

The Terms of Service for the API.

Implementation of

IInfo.termsOfService


title

title: string

The title of the application.

Implementation of

IInfo.title


version

version: string

Provides the version of the application API (not to be confused with the specification version).

Implementation of

IInfo.version

Methods

toJSON

toJSON(): Object

Converts this Info to JSON.

Returns

Object

JSON object


create

create(properties?): Info

Creates a new Info instance using the specified properties.

Parameters

NameTypeDescription
properties?IInfoProperties to set

Returns

Info

Info instance


decode

decode(reader, length?): Info

Decodes an Info message from the specified reader or buffer.

Parameters

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

Returns

Info

Info

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Info

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Info

Info

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

Parameters

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

Returns

Writer

Writer


encodeDelimited

encodeDelimited(message, writer?): Writer

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

Parameters

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

Returns

Writer

Writer


fromObject

fromObject(object): Info

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

Parameters

NameTypeDescription
objectObjectPlain object

Returns

Info

Info


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Info

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

Parameters

NameTypeDescription
messageInfoInfo
options?IConversionOptionsConversion options

Returns

Object

Plain object