build: upgrade to Go 1.18.1 (#373)
This commit is contained in:
@ -508,7 +508,7 @@ func detectContentType(body interface{}) string {
|
||||
kind := reflect.TypeOf(body).Kind()
|
||||
|
||||
switch kind {
|
||||
case reflect.Struct, reflect.Map, reflect.Ptr:
|
||||
case reflect.Struct, reflect.Map, reflect.Pointer:
|
||||
contentType = "application/json; charset=utf-8"
|
||||
case reflect.String:
|
||||
contentType = "text/plain; charset=utf-8"
|
||||
|
@ -31,6 +31,7 @@ multiple locations.
|
||||
* Use `strings.EqualFold` instead of comparing two `strings.ToLower` calls
|
||||
* Update the `GenericOpenAPIError` type to enforce that error response models implement the `error` interface
|
||||
* Update `setBody` to avoid buffering data in memory when the request body is already an `io.ReadCloser`
|
||||
* Update reference from `reflect.Ptr` to `reflect.Pointer` as per the Go 1.18 spec
|
||||
|
||||
`configuration.mustache`
|
||||
* Deleted `ContextOAuth2` key to match modification in client
|
||||
@ -45,3 +46,4 @@ multiple locations.
|
||||
`model_simple.mustache`
|
||||
* Added `yaml:` tags to all model fields to support unmarshalling camelCase
|
||||
* Added support for `x-go-field-type` vendor extension, to explicitly override the type generated for model fields
|
||||
* Use `strings.Cut` when applicable over `strings.IndexByte` and slicing
|
||||
|
@ -492,7 +492,7 @@ func detectContentType(body interface{}) string {
|
||||
kind := reflect.TypeOf(body).Kind()
|
||||
|
||||
switch kind {
|
||||
case reflect.Struct, reflect.Map, reflect.Ptr:
|
||||
case reflect.Struct, reflect.Map, reflect.Pointer:
|
||||
contentType = "application/json; charset=utf-8"
|
||||
case reflect.String:
|
||||
contentType = "text/plain; charset=utf-8"
|
||||
|
@ -325,12 +325,7 @@ return json.Marshal(toSerialize)
|
||||
t := reflect{{{parent}}}.Type().Field(i)
|
||||
|
||||
if jsonTag := t.Tag.Get("json"); jsonTag != "" {
|
||||
fieldName := ""
|
||||
if commaIdx := strings.Index(jsonTag, ","); commaIdx > 0 {
|
||||
fieldName = jsonTag[:commaIdx]
|
||||
} else {
|
||||
fieldName = jsonTag
|
||||
}
|
||||
fieldName, _, _ := strings.Cut(jsonTag, ",")
|
||||
if fieldName != "AdditionalProperties" {
|
||||
delete(additionalProperties, fieldName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user