Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(gen-openapiv2): support trailing comments #2965

Merged
merged 5 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
345 changes: 345 additions & 0 deletions examples/internal/clients/abe/api/swagger.yaml

Large diffs are not rendered by default.

180 changes: 180 additions & 0 deletions examples/internal/clients/abe/api_a_bit_of_everything_service.go

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions examples/internal/clients/abe/model_a_bit_of_everything.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@ type ABitOfEverything struct {
RequiredStringField2 string `json:"requiredStringField2"`
RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"`
RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"`
TrailingOnly string `json:"trailingOnly,omitempty"`
// Trailing only dot.
TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`
// Trailing both.
TrailingBoth string `json:"trailingBoth,omitempty"`
// This is an example of a multi-line comment. Trailing multiline.
TrailingMultiline string `json:"trailingMultiline,omitempty"`
}
7 changes: 7 additions & 0 deletions examples/internal/clients/abe/model_a_bit_of_everything_1.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,11 @@ type ABitOfEverything1 struct {
RequiredStringField2 string `json:"requiredStringField2"`
RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"`
RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"`
TrailingOnly string `json:"trailingOnly,omitempty"`
// Trailing only dot.
TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`
// Trailing both.
TrailingBoth string `json:"trailingBoth,omitempty"`
// This is an example of a multi-line comment. Trailing multiline.
TrailingMultiline string `json:"trailingMultiline,omitempty"`
}
7 changes: 7 additions & 0 deletions examples/internal/clients/abe/model_a_bit_of_everything_2.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@ type ABitOfEverything2 struct {
RequiredStringField2 string `json:"requiredStringField2"`
RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"`
RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"`
TrailingOnly string `json:"trailingOnly,omitempty"`
// Trailing only dot.
TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`
// Trailing both.
TrailingBoth string `json:"trailingBoth,omitempty"`
// This is an example of a multi-line comment. Trailing multiline.
TrailingMultiline string `json:"trailingMultiline,omitempty"`
}
7 changes: 7 additions & 0 deletions examples/internal/clients/abe/model_a_bit_of_everything_3.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@ type ABitOfEverything3 struct {
RequiredStringField2 string `json:"requiredStringField2"`
RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"`
RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"`
TrailingOnly string `json:"trailingOnly,omitempty"`
// Trailing only dot.
TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`
// Trailing both.
TrailingBoth string `json:"trailingBoth,omitempty"`
// This is an example of a multi-line comment. Trailing multiline.
TrailingMultiline string `json:"trailingMultiline,omitempty"`
}
7 changes: 7 additions & 0 deletions examples/internal/clients/abe/model_a_bit_of_everything_4.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,11 @@ type ABitOfEverything4 struct {
RequiredStringField2 string `json:"requiredStringField2,omitempty"`
RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom,omitempty"`
RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom,omitempty"`
TrailingOnly string `json:"trailingOnly,omitempty"`
// Trailing only dot.
TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`
// Trailing both.
TrailingBoth string `json:"trailingBoth,omitempty"`
// This is an example of a multi-line comment. Trailing multiline.
TrailingMultiline string `json:"trailingMultiline,omitempty"`
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,11 @@ type ExamplepbABitOfEverything struct {
RequiredStringField2 string `json:"requiredStringField2"`
RequiredFieldBehaviorJsonNameCustom string `json:"required_field_behavior_json_name_custom"`
RequiredFieldSchemaJsonNameCustom string `json:"required_field_schema_json_name_custom"`
TrailingOnly string `json:"trailingOnly,omitempty"`
// Trailing only dot.
TrailingOnlyDot string `json:"trailingOnlyDot,omitempty"`
// Trailing both.
TrailingBoth string `json:"trailingBoth,omitempty"`
// This is an example of a multi-line comment. Trailing multiline.
TrailingMultiline string `json:"trailingMultiline,omitempty"`
}
1,513 changes: 780 additions & 733 deletions examples/internal/proto/examplepb/a_bit_of_everything.pb.go

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions examples/internal/proto/examplepb/a_bit_of_everything.proto
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,15 @@ message ABitOfEverything {
(google.api.field_behavior) = REQUIRED
];
string required_field_schema_json_name = 46 [json_name = "required_field_schema_json_name_custom"];

string trailing_only = 47; // Trailing only
string trailing_only_dot = 48; // Trailing only dot.
// Leading both
string trailing_both = 49; // Trailing both.
// Leading multiline
//
// This is an example of a multi-line comment.
string trailing_multiline = 50; // Trailing multiline.
}

// ABitOfEverythingRepeated is used to validate repeated path parameter functionality
Expand Down
Loading