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

Implements

Constructors

constructor

new Parameters(properties?): Parameters

Constructs a new Parameters.

Parameters

NameTypeDescription
properties?IParametersProperties to set

Returns

Parameters

Properties

headers

headers: IHeaderParameter[]

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

Implementation of

IParameters.headers

Methods

toJSON

toJSON(): Object

Converts this Parameters to JSON.

Returns

Object

JSON object


create

create(properties?): Parameters

Creates a new Parameters instance using the specified properties.

Parameters

NameTypeDescription
properties?IParametersProperties to set

Returns

Parameters

Parameters instance


decode

decode(reader, length?): Parameters

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

Parameters

Throws

If the payload is not a reader or valid buffer

Throws

If required fields are missing


decodeDelimited

decodeDelimited(reader): Parameters

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

Parameters

NameTypeDescription
readerUint8Array | ReaderReader or buffer to decode from

Returns

Parameters

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
messageIParametersParameters 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
messageIParametersParameters 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


getTypeUrl

getTypeUrl(typeUrlPrefix?): string

Gets the default type url for Parameters

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

Parameters

NameTypeDescription
messageParametersParameters
options?IConversionOptionsConversion options

Returns

Object

Plain object