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
| Name | Type | Description |
|---|---|---|
properties? | IInfo | Properties to set |
Returns
Properties
contact
• Optional contact: null | IContact
The contact information for the exposed API.
Implementation of
description
• description: string
A short description of the application. 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
license
• Optional license: null | ILicense
The license information for the exposed API.
Implementation of
termsOfService
• termsOfService: string
The Terms of Service for the API.
Implementation of
title
• title: string
The title of the application.
Implementation of
version
• version: string
Provides the version of the application API (not to be confused with the specification version).
Implementation of
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
| Name | Type | Description |
|---|---|---|
properties? | IInfo | Properties to set |
Returns
Info instance
decode
▸ decode(reader, length?): Info
Decodes an Info 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
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
| Name | Type | Description |
|---|---|---|
reader | Uint8Array | Reader | Reader or buffer to decode from |
Returns
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
| Name | Type | Description |
|---|---|---|
message | IInfo | Info message or plain object to encode |
writer? | Writer | Writer 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
| Name | Type | Description |
|---|---|---|
message | IInfo | Info message or plain object to encode |
writer? | Writer | Writer 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
| Name | Type | Description |
|---|---|---|
object | Object | Plain object |
Returns
Info
getTypeUrl
▸ getTypeUrl(typeUrlPrefix?): string
Gets the default type url for Info
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 an Info message. Also converts values to other types if specified.
Parameters
| Name | Type | Description |
|---|---|---|
message | Info | Info |
options? | IConversionOptions | Conversion options |
Returns
Object
Plain object