Skip to content

Commit

Permalink
863 fixing swagger generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fahernandez authored and achew22 committed Feb 14, 2019
1 parent 1afb80b commit 46533c5
Show file tree
Hide file tree
Showing 7 changed files with 235 additions and 269 deletions.
14 changes: 6 additions & 8 deletions examples/clients/abe/a_bit_of_everything_service_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,15 @@ func NewABitOfEverythingServiceApiWithBasePath(basePath string) *ABitOfEverythin
* @param pathEnumValue
* @param nestedPathEnumValue
* @param repeatedEnumValue repeated enum value. it is comma-separated in query
* @param repeatedEnumValueAnnotation Repeated numeric enum description.
* @param enumValueAnnotation Numeric enum description.
* @param repeatedStringAnnotation Repeated string description.
* @return *ExamplepbABitOfEverything
*/
func (a ABitOfEverythingServiceApi) Create(floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string, enumValue string, pathEnumValue string, nestedPathEnumValue string, repeatedEnumValue []string, repeatedEnumValueAnnotation []string, enumValueAnnotation string, repeatedStringAnnotation []string) (*ExamplepbABitOfEverything, *APIResponse, error) {
func (a ABitOfEverythingServiceApi) Create(floatValue float32, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, uint32Value int64, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, nonConventionalNameValue string, enumValue string, pathEnumValue string, nestedPathEnumValue string, repeatedEnumValue []string, enumValueAnnotation string, repeatedStringAnnotation []string) (*ExamplepbABitOfEverything, *APIResponse, error) {

var localVarHttpMethod = strings.ToUpper("Post")
// create path and map variables
localVarPath := a.Configuration.BasePath + "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{repeated_enum_value}/{repeated_enum_value_annotation}/{enum_value_annotation}/{repeated_string_annotation}"
localVarPath := a.Configuration.BasePath + "/v1/example/a_bit_of_everything/{float_value}/{double_value}/{int64_value}/separator/{uint64_value}/{int32_value}/{fixed64_value}/{fixed32_value}/{bool_value}/{string_value}/{uint32_value}/{sfixed32_value}/{sfixed64_value}/{sint32_value}/{sint64_value}/{nonConventionalNameValue}/{enum_value}/{path_enum_value}/{nested_path_enum_value}/{repeated_enum_value}/{enum_value_annotation}/{repeated_string_annotation}"
localVarPath = strings.Replace(localVarPath, "{"+"float_value"+"}", fmt.Sprintf("%v", floatValue), -1)
localVarPath = strings.Replace(localVarPath, "{"+"double_value"+"}", fmt.Sprintf("%v", doubleValue), -1)
localVarPath = strings.Replace(localVarPath, "{"+"int64_value"+"}", fmt.Sprintf("%v", int64Value), -1)
Expand All @@ -90,7 +89,6 @@ func (a ABitOfEverythingServiceApi) Create(floatValue float32, doubleValue float
localVarPath = strings.Replace(localVarPath, "{"+"path_enum_value"+"}", fmt.Sprintf("%v", pathEnumValue), -1)
localVarPath = strings.Replace(localVarPath, "{"+"nested_path_enum_value"+"}", fmt.Sprintf("%v", nestedPathEnumValue), -1)
localVarPath = strings.Replace(localVarPath, "{"+"repeated_enum_value"+"}", fmt.Sprintf("%v", repeatedEnumValue), -1)
localVarPath = strings.Replace(localVarPath, "{"+"repeated_enum_value_annotation"+"}", fmt.Sprintf("%v", repeatedEnumValueAnnotation), -1)
localVarPath = strings.Replace(localVarPath, "{"+"enum_value_annotation"+"}", fmt.Sprintf("%v", enumValueAnnotation), -1)
localVarPath = strings.Replace(localVarPath, "{"+"repeated_string_annotation"+"}", fmt.Sprintf("%v", repeatedStringAnnotation), -1)

Expand Down Expand Up @@ -555,15 +553,15 @@ func (a ABitOfEverythingServiceApi) GetMessageWithBody(id string, body Examplepb
* @param nonConventionalNameValue
* @param timestampValue
* @param repeatedEnumValue repeated enum value. it is comma-separated in query. - ZERO: ZERO means 0 - ONE: ONE means 1
* @param repeatedEnumValueAnnotation Repeated numeric enum title. Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1
* @param repeatedEnumAnnotation Repeated numeric enum title. Repeated numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1
* @param enumValueAnnotation Numeric enum title. Numeric enum description. - ZERO: ZERO means 0 - ONE: ONE means 1
* @param repeatedStringAnnotation Repeated string title. Repeated string description.
* @param nestedAnnotationName name is nested field.
* @param nestedAnnotationAmount
* @param nestedAnnotationOk - FALSE: FALSE is false. - TRUE: TRUE is true.
* @return *interface{}
*/
func (a ABitOfEverythingServiceApi) GetQuery(uuid string, floatValue float32, singleNestedName string, singleNestedAmount int64, singleNestedOk string, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, bytesValue string, uint32Value int64, enumValue string, pathEnumValue string, nestedPathEnumValue string, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, repeatedStringValue []string, oneofString string, nonConventionalNameValue string, timestampValue time.Time, repeatedEnumValue []string, repeatedEnumValueAnnotation []string, enumValueAnnotation string, repeatedStringAnnotation []string, nestedAnnotationName string, nestedAnnotationAmount int64, nestedAnnotationOk string) (*interface{}, *APIResponse, error) {
func (a ABitOfEverythingServiceApi) GetQuery(uuid string, floatValue float32, singleNestedName string, singleNestedAmount int64, singleNestedOk string, doubleValue float64, int64Value string, uint64Value string, int32Value int32, fixed64Value string, fixed32Value int64, boolValue bool, stringValue string, bytesValue string, uint32Value int64, enumValue string, pathEnumValue string, nestedPathEnumValue string, sfixed32Value int32, sfixed64Value string, sint32Value int32, sint64Value string, repeatedStringValue []string, oneofString string, nonConventionalNameValue string, timestampValue time.Time, repeatedEnumValue []string, repeatedEnumAnnotation []string, enumValueAnnotation string, repeatedStringAnnotation []string, nestedAnnotationName string, nestedAnnotationAmount int64, nestedAnnotationOk string) (*interface{}, *APIResponse, error) {

var localVarHttpMethod = strings.ToUpper("Get")
// create path and map variables
Expand Down Expand Up @@ -610,8 +608,8 @@ func (a ABitOfEverythingServiceApi) GetQuery(uuid string, floatValue float32, si
var repeatedEnumValueCollectionFormat = "csv"
localVarQueryParams.Add("repeated_enum_value", a.Configuration.APIClient.ParameterToString(repeatedEnumValue, repeatedEnumValueCollectionFormat))

var repeatedEnumValueAnnotationCollectionFormat = "csv"
localVarQueryParams.Add("repeated_enum_value_annotation", a.Configuration.APIClient.ParameterToString(repeatedEnumValueAnnotation, repeatedEnumValueAnnotationCollectionFormat))
var repeatedEnumAnnotationCollectionFormat = "csv"
localVarQueryParams.Add("repeated_enum_annotation", a.Configuration.APIClient.ParameterToString(repeatedEnumAnnotation, repeatedEnumAnnotationCollectionFormat))

localVarQueryParams.Add("enum_value_annotation", a.Configuration.APIClient.ParameterToString(enumValueAnnotation, ""))
var repeatedStringAnnotationCollectionFormat = "csv"
Expand Down
2 changes: 1 addition & 1 deletion examples/clients/abe/examplepb_a_bit_of_everything.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type ExamplepbABitOfEverything struct {
RepeatedEnumValue []ExamplepbNumericEnum `json:"repeated_enum_value,omitempty"`

// Repeated numeric enum description.
RepeatedEnumValueAnnotation []ExamplepbNumericEnum `json:"repeated_enum_value_annotation,omitempty"`
RepeatedEnumAnnotation []ExamplepbNumericEnum `json:"repeated_enum_annotation,omitempty"`

// Numeric enum description.
EnumValueAnnotation ExamplepbNumericEnum `json:"enum_value_annotation,omitempty"`
Expand Down
Loading

0 comments on commit 46533c5

Please sign in to comment.