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

Prevent overwriting description of map fields #5158

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
144 changes: 36 additions & 108 deletions examples/internal/clients/abe/api/swagger.yaml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions examples/internal/clients/abe/api_a_bit_of_everything.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ ABitOfEverythingApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down
48 changes: 24 additions & 24 deletions examples/internal/clients/abe/api_a_bit_of_everything_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -757,9 +757,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -1139,9 +1139,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -1675,9 +1675,9 @@ This API creates a new ABitOfEverything
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
* @param "RepeatedEnumAnnotation" (optional.Interface of []string) - Repeated numeric enum title Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -2343,9 +2343,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -2735,9 +2735,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -3242,9 +3242,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down Expand Up @@ -3788,9 +3788,9 @@ ABitOfEverythingServiceApiService
* @param "RepeatedStringValue" (optional.Interface of []string) -
* @param "OneofEmpty" (optional.Interface of map[string]string) -
* @param "OneofString" (optional.String) -
* @param "MapValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedStringValue" (optional.String) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MappedNestedValue" (optional.Interface of interface{}) - This is a request variable of the map type. The query format is \"map_name[key]=value\", e.g. If the map name is Age, the key type is string, and the value type is integer, the query parameter is expressed as Age[\"bob\"]=18
* @param "MapValue" (optional.Interface of interface{}) - map of numeric enum
* @param "MappedStringValue" (optional.String) - Map of string title Map of string description.
* @param "MappedNestedValue" (optional.Interface of interface{}) -
* @param "NonConventionalNameValue" (optional.String) -
* @param "TimestampValue" (optional.Time) -
* @param "RepeatedEnumValue" (optional.Interface of []string) - repeated enum value. it is comma-separated in query - ZERO: ZERO means 0 - ONE: ONE means 1
Expand Down
1 change: 1 addition & 0 deletions examples/internal/clients/abe/model_a_bit_of_everything.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ABitOfEverything struct {
OneofEmpty *interface{} `json:"oneofEmpty,omitempty"`
OneofString string `json:"oneofString,omitempty"`
MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"`
// Map of string description.
MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`
MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`
NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ABitOfEverything1 struct {
OneofEmpty *interface{} `json:"oneofEmpty,omitempty"`
OneofString string `json:"oneofString,omitempty"`
MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"`
// Map of string description.
MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`
MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`
NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ABitOfEverything2 struct {
OneofEmpty *interface{} `json:"oneofEmpty,omitempty"`
OneofString string `json:"oneofString,omitempty"`
MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"`
// Map of string description.
MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`
MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`
NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type ABitOfEverythingServiceDeepPathEchoBody struct {
OneofEmpty *interface{} `json:"oneofEmpty,omitempty"`
OneofString string `json:"oneofString,omitempty"`
MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"`
// Map of string description.
MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`
MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`
NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ type ExamplepbABitOfEverything struct {
OneofEmpty *interface{} `json:"oneofEmpty,omitempty"`
OneofString string `json:"oneofString,omitempty"`
MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"`
// Map of string description.
MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`
MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`
NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ExamplepbABitOfEverythingServiceUpdateBody struct {
OneofEmpty *interface{} `json:"oneofEmpty,omitempty"`
OneofString string `json:"oneofString,omitempty"`
MapValue map[string]ExamplepbNumericEnum `json:"mapValue,omitempty"`
// Map of string description.
MappedStringValue map[string]string `json:"mappedStringValue,omitempty"`
MappedNestedValue map[string]ABitOfEverythingNested `json:"mappedNestedValue,omitempty"`
NonConventionalNameValue string `json:"nonConventionalNameValue,omitempty"`
Expand Down
Loading
Loading