Skip to content

Commit

Permalink
docs: add openapi references to new parameters protos
Browse files Browse the repository at this point in the history
Co-Authored-By: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
  • Loading branch information
krak3n and johanbrandhorst committed Nov 14, 2022
1 parent 93e49cf commit b3a8280
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions protoc-gen-openapiv2/options/openapiv2.proto
Expand Up @@ -176,18 +176,24 @@ message Operation {
// See: https://swagger.io/docs/specification/2-0/swagger-extensions/
map<string, google.protobuf.Value> extensions = 13;
// Custom parameters such as HTTP request headers.
// See: https://swagger.io/docs/specification/2-0/describing-parameters/
// and https://swagger.io/specification/v2/#parameter-object.
Parameters parameters = 14;
}

// `Parameters` is a representation of OpenAPI v2 specification's parameters object.
// See: https://swagger.io/specification/v2/#parameter-object
message Parameters {
// `Headers` is one or more HTTP header parameter.
// See: https://swagger.io/docs/specification/2-0/describing-parameters/#header-parameters
repeated HeaderParameter headers = 1;
}

// `HeaderParameter` a HTTP header parameter.
// See: https://swagger.io/specification/v2/#parameter-object
message HeaderParameter {
// `Type` is a a supported HTTP type.
// `Type` is a a supported HTTP header type.
// See https://swagger.io/specification/v2/#parameterType.
enum Type {
UNKNOWN = 0;
STRING = 1;
Expand All @@ -201,14 +207,15 @@ message HeaderParameter {
// `Description` is a short description of the header.
string description = 2;
// `Type` is the type of the object. The value MUST be one of "string", "number", "integer", or "boolean". The "array" type is not supported.
// See: https://swagger.io/specification/v2/#parameterType.
Type type = 3;
// `Format` The extending format for the previously mentioned type.
string format = 4;
// `Required` indicates if the header is optional
bool required = 5;
// field 6 is reserved for 'items', but in OpenAPI-specific way.
reserved 6;
// field 7 is reserved `Collection Format` Determines the format of the array if type array is used.
// field 7 is reserved `Collection Format`. Determines the format of the array if type array is used.
reserved 7;
}

Expand Down

0 comments on commit b3a8280

Please sign in to comment.