add RFC-3339 formatting to parameterToString (#502)

This commit is contained in:
John Wang 2018-07-12 11:50:21 -05:00 committed by William Cheng
parent a0936bec02
commit 93832340a5
3 changed files with 5 additions and 1 deletions

View File

@ -142,6 +142,8 @@ func parameterToString(obj interface{}, collectionFormat string) string {
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
} else if t, ok := obj.(time.Time); ok {
return t.Format(time.RFC3339)
}
return fmt.Sprintf("%v", obj)

View File

@ -1 +1 @@
3.1.0-SNAPSHOT
3.1.1-SNAPSHOT

View File

@ -153,6 +153,8 @@ func parameterToString(obj interface{}, collectionFormat string) string {
if reflect.TypeOf(obj).Kind() == reflect.Slice {
return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]")
} else if t, ok := obj.(time.Time); ok {
return t.Format(time.RFC3339)
}
return fmt.Sprintf("%v", obj)