Skip to content

Commit 9221822

Browse files
Fabian Hernandezjohanbrandhorst
authored andcommitted
Adding support for default and required swagger annotation fields. (#852)
* Adding support for default and required swagger annotation fields:Solves issue #851 * Fixing test for swagger generation * updating swagger definition * removing breaking changes over enums * Adding example for required field as an array
1 parent 078fa17 commit 9221822

File tree

6 files changed

+251
-216
lines changed

6 files changed

+251
-216
lines changed

examples/clients/abe/a_bit_of_everything_service_api.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func NewABitOfEverythingServiceApiWithBasePath(basePath string) *ABitOfEverythin
4242
* Create a new ABitOfEverything
4343
* This API creates a new ABitOfEverything
4444
*
45-
* @param floatValue
45+
* @param floatValue Float value field
4646
* @param doubleValue
4747
* @param int64Value
4848
* @param uint64Value
@@ -521,10 +521,10 @@ func (a ABitOfEverythingServiceApi) GetMessageWithBody(id string, body Examplepb
521521
*
522522
*
523523
* @param uuid
524+
* @param floatValue Float value field
524525
* @param singleNestedName name is nested field.
525526
* @param singleNestedAmount
526527
* @param singleNestedOk - FALSE: FALSE is false. - TRUE: TRUE is true.
527-
* @param floatValue
528528
* @param doubleValue
529529
* @param int64Value
530530
* @param uint64Value
@@ -549,7 +549,7 @@ func (a ABitOfEverythingServiceApi) GetMessageWithBody(id string, body Examplepb
549549
* @param repeatedEnumValue repeated enum value. it is comma-separated in query. - ZERO: ZERO means 0 - ONE: ONE means 1
550550
* @return *interface{}
551551
*/
552-
func (a ABitOfEverythingServiceApi) GetQuery(uuid string, singleNestedName string, singleNestedAmount int64, singleNestedOk string, floatValue float32, 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) (*interface{}, *APIResponse, error) {
552+
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) (*interface{}, *APIResponse, error) {
553553

554554
var localVarHttpMethod = strings.ToUpper("Get")
555555
// create path and map variables

examples/clients/abe/examplepb_a_bit_of_everything.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,12 @@ type ExamplepbABitOfEverything struct {
2323

2424
Nested []ABitOfEverythingNested `json:"nested,omitempty"`
2525

26+
// Float value field
2627
FloatValue float32 `json:"float_value,omitempty"`
2728

28-
DoubleValue float64 `json:"double_value,omitempty"`
29+
DoubleValue float64 `json:"double_value"`
2930

30-
Int64Value string `json:"int64_value,omitempty"`
31+
Int64Value string `json:"int64_value"`
3132

3233
Uint64Value string `json:"uint64_value,omitempty"`
3334

0 commit comments

Comments
 (0)