Skip to main content

Class: Parameters

protoc_gen_openapiv2.options.Parameters

Parameters is a representation of OpenAPI v2 specification's parameters object. Note: This technically breaks compatibility with the OpenAPI 2 definition structure as we only allow header parameters to be set here since we do not want users specifying custom non-header parameters beyond those inferred from the Protobuf schema. See: https://swagger.io/specification/v2/#parameter-object

Properties​

headers​

• headers: $Properties[]

Headers is one or more HTTP header parameter. See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters

Methods​

toJSON​

▸ toJSON(): Object

Converts this Parameters to JSON.

Returns​

Object

JSON object


create​

▸ create(properties?): Parameters & $Properties

Creates a new Parameters instance using the specified properties.

Parameters​

NameTypeDescription
properties?$PropertiesProperties to set

Returns​

Parameters & $Properties

Parameters instance

▸ create(properties?): Parameters

Parameters​

NameType
properties?$Properties

Returns​

Parameters


decode​

▸ decode(reader, length?): Parameters & $Properties

Decodes a Parameters message from the specified reader or buffer.

Parameters​

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

Returns​

Parameters & $Properties

Parameters

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited​

▸ decodeDelimited(reader): Parameters & $Properties

Decodes a Parameters message from the specified reader or buffer, length delimited.

Parameters​

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns​

Parameters & $Properties

Parameters

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

Parameters​

NameTypeDescription
message$PropertiesParameters message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


encodeDelimited​

▸ encodeDelimited(message, writer?): Writer

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

Parameters​

NameTypeDescription
message$PropertiesParameters message or plain object to encode
writer?WriterWriter to encode to

Returns​

Writer

Writer


fromObject​

▸ fromObject(object): Parameters

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

Parameters​

NameTypeDescription
objectObjectPlain object

Returns​

Parameters

Parameters


toObject​

▸ toObject(message, options?): Object

Creates a plain object from a Parameters message. Also converts values to other types if specified.

Parameters​

NameTypeDescription
messageParametersParameters
options?IConversionOptionsConversion options

Returns​

Object

Plain object