Skip to content

Commit 8cc457b

Browse files
author
Josh Newman
committed
feat: add path parameters
1 parent ff81826 commit 8cc457b

File tree

11 files changed

+636
-222
lines changed

11 files changed

+636
-222
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ service MyService {
150150

151151
## Features In Progress
152152

153-
- Path Parameters and Query
153+
- Query Parameters
154+
- Header Parameters
155+
- Cookie Parameters
154156
- [Enum](https://json-schema.org/understanding-json-schema/reference/generic.html#enumerated-values)
155157
requirements on fields
156158

api/oapi/v1/field.pb.go

Lines changed: 66 additions & 91 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/oapi/v1/field.proto

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,51 +19,44 @@ extend google.protobuf.FieldOptions {
1919
}
2020

2121
message FieldOptions {
22-
// Marks the field as required.
23-
optional bool required = 1;
24-
25-
// Value for the example on the field. This overrides any examples in
26-
// comments.
27-
optional string example = 2;
28-
2922
// Minimum value for the field.
30-
optional double min = 3;
23+
optional double min = 1;
3124

3225
// Maximum value for the field.
33-
optional double max = 4;
26+
optional double max = 2;
3427

3528
// Minimum length for the field.
36-
optional uint64 min_length = 5;
29+
optional uint64 min_length = 3;
3730

3831
// Maximum length for the field.
39-
optional uint64 max_length = 6;
32+
optional uint64 max_length = 4;
4033

4134
// Minimum amount of items for an array type.
42-
optional uint64 min_items = 7;
35+
optional uint64 min_items = 5;
4336

4437
// Maximum amount of items for an array type.
45-
optional uint64 max_items = 8;
38+
optional uint64 max_items = 6;
4639

4740
// All items in the array should be unique.
48-
optional bool unique_items = 9;
41+
optional bool unique_items = 7;
4942

5043
// Minimum amount of properties that the field object can have.
51-
optional uint64 min_properties = 10;
44+
optional uint64 min_properties = 8;
5245

5346
// Maximum amount of properties that the field object can have.
54-
optional uint64 max_properties = 11;
47+
optional uint64 max_properties = 9;
5548

5649
// Regex pattern for the field to match. Refer to
5750
// https://www.ecma-international.org/ecma-262/5.1/#sec-15.10.1
58-
optional string pattern = 12;
51+
optional string pattern = 10;
5952

6053
// Minimum value of min excluding the defined. e.g. If min=100, 101 is the
6154
// min.
62-
optional bool exclusive_min = 13;
55+
optional bool exclusive_min = 11;
6356

6457
// Maximum value of max excluding the defined. e.g. If max=100, 99 is the max.
65-
optional bool exclusive_max = 14;
58+
optional bool exclusive_max = 12;
6659

6760
// The number that the value must be a multiple of.
68-
optional double multiple_of = 15;
61+
optional double multiple_of = 13;
6962
}

api/oapi/v1/method.pb.go

Lines changed: 61 additions & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/oapi/v1/method.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ syntax = "proto3";
33
package oapi.v1;
44

55
import "google/protobuf/descriptor.proto";
6+
import "oapi/v1/parameter.proto";
67

78
option go_package = "github.com/technicallyjosh/protoc-gen-openapi/api/oapi/v1;oapiv1";
89

@@ -46,4 +47,7 @@ message MethodOptions {
4647

4748
// Summary for the method. Generally a friendly alternative name.
4849
string summary = 11;
50+
51+
// Path parameters for the method.
52+
repeated Parameter path_parameter = 12;
4953
}

0 commit comments

Comments
 (0)