forked from loafle/openapi-generator-original
Issue 11401 - report correctly the parameters with the deep object specification (#13909)
* issue #11401 - Go client generator doesn't support deepObject in query * samples generation * fix generation * fix generation * generated samples # Conflicts: # samples/client/petstore/go/go-petstore/model_200_response.go # samples/client/petstore/go/go-petstore/model_additional_properties_any_type.go # samples/client/petstore/go/go-petstore/model_client.go * Fixed unit tests * revert to http connection for tests * fix model_simple generation * Fix parameter encoding issue * simplified routine * fix test url * adapted for latest master, necessary generation * samples generation * sync with new master, regenerate samples * added api client test
This commit is contained in:
parent
95b566a3a9
commit
4487042f0d
@ -124,7 +124,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "{{{path}}}"{{#pathParams}}
|
localVarPath := localBasePath + "{{{path}}}"{{#pathParams}}
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", url.PathEscape(parameterToString(r.{{paramName}}, "{{collectionFormat}}")), -1){{/pathParams}}
|
localVarPath = strings.Replace(localVarPath, "{"+"{{baseName}}"+"}", url.PathEscape(parameterValueToString(r.{{paramName}}, "{{paramName}}")), -1){{/pathParams}}
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -189,15 +189,15 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
|||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{collectionFormat}}"))
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", s.Index(i), "{{collectionFormat}}")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{collectionFormat}}"))
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", t, "{{collectionFormat}}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
{{^isCollectionFormatMulti}}
|
{{^isCollectionFormatMulti}}
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{collectionFormat}}"))
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}")
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{^required}}
|
{{^required}}
|
||||||
@ -207,14 +207,14 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
|||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(s.Index(i), "{{collectionFormat}}"))
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", s.Index(i), "{{collectionFormat}}")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(t, "{{collectionFormat}}"))
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", t, "{{collectionFormat}}")
|
||||||
}
|
}
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
{{^isCollectionFormatMulti}}
|
{{^isCollectionFormatMulti}}
|
||||||
localVarQueryParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{collectionFormat}}"))
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}")
|
||||||
{{/isCollectionFormatMulti}}
|
{{/isCollectionFormatMulti}}
|
||||||
}
|
}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
@ -242,11 +242,11 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
|||||||
}
|
}
|
||||||
{{#headerParams}}
|
{{#headerParams}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
localVarHeaderParams["{{baseName}}"] = parameterToString(*r.{{paramName}}, "{{collectionFormat}}")
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}")
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{^required}}
|
{{^required}}
|
||||||
if r.{{paramName}} != nil {
|
if r.{{paramName}} != nil {
|
||||||
localVarHeaderParams["{{baseName}}"] = parameterToString(*r.{{paramName}}, "{{collectionFormat}}")
|
parameterAddToQuery(localVarQueryParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}")
|
||||||
}
|
}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{/headerParams}}
|
{{/headerParams}}
|
||||||
@ -277,7 +277,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
|||||||
{{/isFile}}
|
{{/isFile}}
|
||||||
{{^isFile}}
|
{{^isFile}}
|
||||||
{{#required}}
|
{{#required}}
|
||||||
localVarFormParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{collectionFormat}}"))
|
parameterAddToQuery(localVarFormParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}")
|
||||||
{{/required}}
|
{{/required}}
|
||||||
{{^required}}
|
{{^required}}
|
||||||
{{#isModel}}
|
{{#isModel}}
|
||||||
@ -291,7 +291,7 @@ func (a *{{{classname}}}Service) {{nickname}}Execute(r {{#structPrefix}}{{&class
|
|||||||
{{/isModel}}
|
{{/isModel}}
|
||||||
{{^isModel}}
|
{{^isModel}}
|
||||||
if r.{{paramName}} != nil {
|
if r.{{paramName}} != nil {
|
||||||
localVarFormParams.Add("{{baseName}}", parameterToString(*r.{{paramName}}, "{{collectionFormat}}"))
|
parameterAddToQuery(localVarFormParams, "{{baseName}}", r.{{paramName}}, "{{collectionFormat}}")
|
||||||
}
|
}
|
||||||
{{/isModel}}
|
{{/isModel}}
|
||||||
{{/required}}
|
{{/required}}
|
||||||
|
@ -34,6 +34,8 @@ import (
|
|||||||
var (
|
var (
|
||||||
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
||||||
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
||||||
|
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
|
||||||
|
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" )
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIClient manages communication with the {{appName}} API v{{version}}
|
// APIClient manages communication with the {{appName}} API v{{version}}
|
||||||
@ -132,28 +134,101 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
|
func parameterValueToString( obj interface{}, key string ) string {
|
||||||
func parameterToString(obj interface{}, collectionFormat string) string {
|
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
||||||
var delimiter string
|
|
||||||
|
|
||||||
switch collectionFormat {
|
|
||||||
case "pipes":
|
|
||||||
delimiter = "|"
|
|
||||||
case "ssv":
|
|
||||||
delimiter = " "
|
|
||||||
case "tsv":
|
|
||||||
delimiter = "\t"
|
|
||||||
case "csv":
|
|
||||||
delimiter = ","
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
return fmt.Sprintf("%v", obj)
|
||||||
|
}
|
||||||
|
var param,ok = obj.(MappedNullable)
|
||||||
|
if !ok {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
dataMap,err := param.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%v", dataMap[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
// parameterAddToQuery adds the provided object to the url query supporting deep object syntax
|
||||||
|
func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
|
||||||
|
var v = reflect.ValueOf(obj)
|
||||||
|
var value = ""
|
||||||
|
if v == reflect.ValueOf(nil) {
|
||||||
|
value = "null"
|
||||||
|
} else {
|
||||||
|
switch v.Kind() {
|
||||||
|
case reflect.Invalid:
|
||||||
|
value = "invalid"
|
||||||
|
|
||||||
|
case reflect.Struct:
|
||||||
|
if t,ok := obj.(MappedNullable); ok {
|
||||||
|
dataMap,err := t.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if t, ok := obj.(time.Time); ok {
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
case reflect.Slice:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var lenIndValue = indValue.Len()
|
||||||
|
for i:=0;i<lenIndValue;i++ {
|
||||||
|
var arrayValue = indValue.Index(i)
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, arrayValue.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Map:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
iter := indValue.MapRange()
|
||||||
|
for iter.Next() {
|
||||||
|
k,v := iter.Key(), iter.Value()
|
||||||
|
parameterAddToQuery(queryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Interface:
|
||||||
|
fallthrough
|
||||||
|
case reflect.Ptr:
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, v.Elem().Interface(), collectionType)
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||||
|
reflect.Int32, reflect.Int64:
|
||||||
|
value = strconv.FormatInt(v.Int(), 10)
|
||||||
|
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||||
|
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||||
|
value = strconv.FormatUint(v.Uint(), 10)
|
||||||
|
case reflect.Float32, reflect.Float64:
|
||||||
|
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||||
|
case reflect.Bool:
|
||||||
|
value = strconv.FormatBool(v.Bool())
|
||||||
|
case reflect.String:
|
||||||
|
value = v.String()
|
||||||
|
default:
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch valuesMap := queryParams.(type) {
|
||||||
|
case url.Values:
|
||||||
|
valuesMap.Add( keyPrefix, value )
|
||||||
|
break
|
||||||
|
case map[string]string:
|
||||||
|
valuesMap[keyPrefix] = value
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper for converting interface{} parameters to json strings
|
// helper for converting interface{} parameters to json strings
|
||||||
@ -305,7 +380,11 @@ func (c *APIClient) prepareRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Encode the parameters.
|
// Encode the parameters.
|
||||||
url.RawQuery = query.Encode()
|
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
||||||
|
pieces := strings.Split(s, "=")
|
||||||
|
pieces[0] = queryDescape.Replace(pieces[0])
|
||||||
|
return strings.Join(pieces, "=")
|
||||||
|
})
|
||||||
|
|
||||||
// Generate a new request
|
// Generate a new request
|
||||||
if body != nil {
|
if body != nil {
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
// checks if the {{classname}} type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &{{classname}}{}
|
||||||
|
|
||||||
// {{classname}} {{{description}}}{{^description}}struct for {{{classname}}}{{/description}}
|
// {{classname}} {{{description}}}{{^description}}struct for {{{classname}}}{{/description}}
|
||||||
type {{classname}} struct {
|
type {{classname}} struct {
|
||||||
{{#parent}}
|
{{#parent}}
|
||||||
@ -123,7 +126,7 @@ func (o *{{classname}}) Get{{name}}() {{vendorExtensions.x-go-base-type}} {
|
|||||||
{{/deprecated}}
|
{{/deprecated}}
|
||||||
func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) {
|
func (o *{{classname}}) Get{{name}}Ok() ({{^isArray}}{{^isFreeFormObject}}*{{/isFreeFormObject}}{{/isArray}}{{vendorExtensions.x-go-base-type}}, bool) {
|
||||||
if o == nil{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || isNil(o.{{name}}){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
|
if o == nil{{#isNullable}}{{#vendorExtensions.x-golang-is-container}} || isNil(o.{{name}}){{/vendorExtensions.x-golang-is-container}}{{/isNullable}} {
|
||||||
{{^isFreeFormObject}}
|
{{^isFreeFormObject}}
|
||||||
return nil, false
|
return nil, false
|
||||||
{{/isFreeFormObject}}
|
{{/isFreeFormObject}}
|
||||||
{{#isFreeFormObject}}
|
{{#isFreeFormObject}}
|
||||||
@ -258,17 +261,25 @@ func (o *{{classname}}) Unset{{name}}() {
|
|||||||
{{/required}}
|
{{/required}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
func (o {{classname}}) MarshalJSON() ([]byte, error) {
|
func (o {{classname}}) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o {{classname}}) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := {{#isArray}}make([]interface{}, len(o.Items)){{/isArray}}{{^isArray}}map[string]interface{}{}{{/isArray}}
|
toSerialize := {{#isArray}}make([]interface{}, len(o.Items)){{/isArray}}{{^isArray}}map[string]interface{}{}{{/isArray}}
|
||||||
{{#parent}}
|
{{#parent}}
|
||||||
{{^isMap}}
|
{{^isMap}}
|
||||||
{{^isArray}}
|
{{^isArray}}
|
||||||
serialized{{parent}}, err{{parent}} := json.Marshal(o.{{parent}})
|
serialized{{parent}}, err{{parent}} := json.Marshal(o.{{parent}})
|
||||||
if err{{parent}} != nil {
|
if err{{parent}} != nil {
|
||||||
return []byte{}, err{{parent}}
|
return map[string]interface{}{}, err{{parent}}
|
||||||
}
|
}
|
||||||
err{{parent}} = json.Unmarshal([]byte(serialized{{parent}}), &toSerialize)
|
err{{parent}} = json.Unmarshal([]byte(serialized{{parent}}), &toSerialize)
|
||||||
if err{{parent}} != nil {
|
if err{{parent}} != nil {
|
||||||
return []byte{}, err{{parent}}
|
return map[string]interface{}{}, err{{parent}}
|
||||||
}
|
}
|
||||||
{{/isArray}}
|
{{/isArray}}
|
||||||
{{/isMap}}
|
{{/isMap}}
|
||||||
@ -288,16 +299,26 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
{{/vendorExtensions.x-golang-is-container}}
|
{{/vendorExtensions.x-golang-is-container}}
|
||||||
{{^vendorExtensions.x-golang-is-container}}
|
{{^vendorExtensions.x-golang-is-container}}
|
||||||
if {{#required}}true{{/required}}{{^required}}o.{{name}}.IsSet(){{/required}} {
|
{{#required}}
|
||||||
|
toSerialize["{{baseName}}"] = o.{{name}}.Get()
|
||||||
|
{{/required}}
|
||||||
|
{{^required}}
|
||||||
|
if o.{{name}}.IsSet() {
|
||||||
toSerialize["{{baseName}}"] = o.{{name}}.Get()
|
toSerialize["{{baseName}}"] = o.{{name}}.Get()
|
||||||
}
|
}
|
||||||
|
{{/required}}
|
||||||
{{/vendorExtensions.x-golang-is-container}}
|
{{/vendorExtensions.x-golang-is-container}}
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
{{! if argument is not nullable, don't set it if it is nil}}
|
{{! if argument is not nullable, don't set it if it is nil}}
|
||||||
{{^isNullable}}
|
{{^isNullable}}
|
||||||
if {{#required}}true{{/required}}{{^required}}!isNil(o.{{name}}){{/required}} {
|
{{#required}}
|
||||||
|
toSerialize["{{baseName}}"] = o.{{name}}
|
||||||
|
{{/required}}
|
||||||
|
{{^required}}
|
||||||
|
if !isNil(o.{{name}}) {
|
||||||
toSerialize["{{baseName}}"] = o.{{name}}
|
toSerialize["{{baseName}}"] = o.{{name}}
|
||||||
}
|
}
|
||||||
|
{{/required}}
|
||||||
{{/isNullable}}
|
{{/isNullable}}
|
||||||
{{/vars}}
|
{{/vars}}
|
||||||
{{#isAdditionalPropertiesTrue}}
|
{{#isAdditionalPropertiesTrue}}
|
||||||
@ -307,7 +328,7 @@ func (o {{classname}}) MarshalJSON() ([]byte, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{{/isAdditionalPropertiesTrue}}
|
{{/isAdditionalPropertiesTrue}}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
{{#isAdditionalPropertiesTrue}}
|
{{#isAdditionalPropertiesTrue}}
|
||||||
|
@ -332,3 +332,7 @@ func isNil(i interface{}) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MappedNullable interface {
|
||||||
|
ToMap() (map[string]interface{}, error)
|
||||||
|
}
|
||||||
|
@ -842,7 +842,7 @@ paths:
|
|||||||
'5XX':
|
'5XX':
|
||||||
description: Something wrong
|
description: Something wrong
|
||||||
content:
|
content:
|
||||||
'applicatino/json':
|
'application/json':
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/OuterNumber'
|
$ref: '#/components/schemas/OuterNumber'
|
||||||
/fake/outer/number:
|
/fake/outer/number:
|
||||||
@ -1155,6 +1155,29 @@ paths:
|
|||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/HealthCheckResult'
|
$ref: '#/components/schemas/HealthCheckResult'
|
||||||
|
/fake/deep_object_test:
|
||||||
|
get:
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
|
operationId: test_query_deep_object
|
||||||
|
parameters:
|
||||||
|
- name: test_pet
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
style: deepObject
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Pet'
|
||||||
|
explode: true
|
||||||
|
- name: inputOptions
|
||||||
|
in: query
|
||||||
|
required: false
|
||||||
|
style: deepObject
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Category'
|
||||||
|
explode: true
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
servers:
|
servers:
|
||||||
- url: 'http://{server}.swagger.io:{port}/v2'
|
- url: 'http://{server}.swagger.io:{port}/v2'
|
||||||
description: petstore server
|
description: petstore server
|
||||||
|
@ -902,7 +902,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa
|
|||||||
return nil, reportError("body is required and must be specified")
|
return nil, reportError("body is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("query", parameterToString(*r.query, ""))
|
parameterAddToQuery(localVarQueryParams, "query", r.query, "")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
localVarHTTPContentTypes := []string{"application/json"}
|
||||||
|
|
||||||
@ -1247,24 +1247,24 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.integer != nil {
|
if r.integer != nil {
|
||||||
localVarFormParams.Add("integer", parameterToString(*r.integer, ""))
|
parameterAddToQuery(localVarFormParams, "integer", r.integer, "")
|
||||||
}
|
}
|
||||||
if r.int32_ != nil {
|
if r.int32_ != nil {
|
||||||
localVarFormParams.Add("int32", parameterToString(*r.int32_, ""))
|
parameterAddToQuery(localVarFormParams, "int32", r.int32_, "")
|
||||||
}
|
}
|
||||||
if r.int64_ != nil {
|
if r.int64_ != nil {
|
||||||
localVarFormParams.Add("int64", parameterToString(*r.int64_, ""))
|
parameterAddToQuery(localVarFormParams, "int64", r.int64_, "")
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("number", parameterToString(*r.number, ""))
|
parameterAddToQuery(localVarFormParams, "number", r.number, "")
|
||||||
if r.float != nil {
|
if r.float != nil {
|
||||||
localVarFormParams.Add("float", parameterToString(*r.float, ""))
|
parameterAddToQuery(localVarFormParams, "float", r.float, "")
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("double", parameterToString(*r.double, ""))
|
parameterAddToQuery(localVarFormParams, "double", r.double, "")
|
||||||
if r.string_ != nil {
|
if r.string_ != nil {
|
||||||
localVarFormParams.Add("string", parameterToString(*r.string_, ""))
|
parameterAddToQuery(localVarFormParams, "string", r.string_, "")
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, ""))
|
parameterAddToQuery(localVarFormParams, "pattern_without_delimiter", r.patternWithoutDelimiter, "")
|
||||||
localVarFormParams.Add("byte", parameterToString(*r.byte_, ""))
|
parameterAddToQuery(localVarFormParams, "byte", r.byte_, "")
|
||||||
var binaryLocalVarFormFileName string
|
var binaryLocalVarFormFileName string
|
||||||
var binaryLocalVarFileName string
|
var binaryLocalVarFileName string
|
||||||
var binaryLocalVarFileBytes []byte
|
var binaryLocalVarFileBytes []byte
|
||||||
@ -1283,16 +1283,16 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete
|
|||||||
}
|
}
|
||||||
formFiles = append(formFiles, formFile{fileBytes: binaryLocalVarFileBytes, fileName: binaryLocalVarFileName, formFileName: binaryLocalVarFormFileName})
|
formFiles = append(formFiles, formFile{fileBytes: binaryLocalVarFileBytes, fileName: binaryLocalVarFileName, formFileName: binaryLocalVarFormFileName})
|
||||||
if r.date != nil {
|
if r.date != nil {
|
||||||
localVarFormParams.Add("date", parameterToString(*r.date, ""))
|
parameterAddToQuery(localVarFormParams, "date", r.date, "")
|
||||||
}
|
}
|
||||||
if r.dateTime != nil {
|
if r.dateTime != nil {
|
||||||
localVarFormParams.Add("dateTime", parameterToString(*r.dateTime, ""))
|
parameterAddToQuery(localVarFormParams, "dateTime", r.dateTime, "")
|
||||||
}
|
}
|
||||||
if r.password != nil {
|
if r.password != nil {
|
||||||
localVarFormParams.Add("password", parameterToString(*r.password, ""))
|
parameterAddToQuery(localVarFormParams, "password", r.password, "")
|
||||||
}
|
}
|
||||||
if r.callback != nil {
|
if r.callback != nil {
|
||||||
localVarFormParams.Add("callback", parameterToString(*r.callback, ""))
|
parameterAddToQuery(localVarFormParams, "callback", r.callback, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1422,16 +1422,16 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques
|
|||||||
localVarFormParams := url.Values{}
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
if r.enumQueryStringArray != nil {
|
if r.enumQueryStringArray != nil {
|
||||||
localVarQueryParams.Add("enum_query_string_array", parameterToString(*r.enumQueryStringArray, "csv"))
|
parameterAddToQuery(localVarQueryParams, "enum_query_string_array", r.enumQueryStringArray, "csv")
|
||||||
}
|
}
|
||||||
if r.enumQueryString != nil {
|
if r.enumQueryString != nil {
|
||||||
localVarQueryParams.Add("enum_query_string", parameterToString(*r.enumQueryString, ""))
|
parameterAddToQuery(localVarQueryParams, "enum_query_string", r.enumQueryString, "")
|
||||||
}
|
}
|
||||||
if r.enumQueryInteger != nil {
|
if r.enumQueryInteger != nil {
|
||||||
localVarQueryParams.Add("enum_query_integer", parameterToString(*r.enumQueryInteger, ""))
|
parameterAddToQuery(localVarQueryParams, "enum_query_integer", r.enumQueryInteger, "")
|
||||||
}
|
}
|
||||||
if r.enumQueryDouble != nil {
|
if r.enumQueryDouble != nil {
|
||||||
localVarQueryParams.Add("enum_query_double", parameterToString(*r.enumQueryDouble, ""))
|
parameterAddToQuery(localVarQueryParams, "enum_query_double", r.enumQueryDouble, "")
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"}
|
localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||||
@ -1451,16 +1451,16 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.enumHeaderStringArray != nil {
|
if r.enumHeaderStringArray != nil {
|
||||||
localVarHeaderParams["enum_header_string_array"] = parameterToString(*r.enumHeaderStringArray, "csv")
|
parameterAddToQuery(localVarQueryParams, "enum_header_string_array", r.enumHeaderStringArray, "csv")
|
||||||
}
|
}
|
||||||
if r.enumHeaderString != nil {
|
if r.enumHeaderString != nil {
|
||||||
localVarHeaderParams["enum_header_string"] = parameterToString(*r.enumHeaderString, "")
|
parameterAddToQuery(localVarQueryParams, "enum_header_string", r.enumHeaderString, "")
|
||||||
}
|
}
|
||||||
if r.enumFormStringArray != nil {
|
if r.enumFormStringArray != nil {
|
||||||
localVarFormParams.Add("enum_form_string_array", parameterToString(*r.enumFormStringArray, "csv"))
|
parameterAddToQuery(localVarFormParams, "enum_form_string_array", r.enumFormStringArray, "csv")
|
||||||
}
|
}
|
||||||
if r.enumFormString != nil {
|
if r.enumFormString != nil {
|
||||||
localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, ""))
|
parameterAddToQuery(localVarFormParams, "enum_form_string", r.enumFormString, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1584,13 +1584,13 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ
|
|||||||
return nil, reportError("requiredInt64Group is required and must be specified")
|
return nil, reportError("requiredInt64Group is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, ""))
|
parameterAddToQuery(localVarQueryParams, "required_string_group", r.requiredStringGroup, "")
|
||||||
localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, ""))
|
parameterAddToQuery(localVarQueryParams, "required_int64_group", r.requiredInt64Group, "")
|
||||||
if r.stringGroup != nil {
|
if r.stringGroup != nil {
|
||||||
localVarQueryParams.Add("string_group", parameterToString(*r.stringGroup, ""))
|
parameterAddToQuery(localVarQueryParams, "string_group", r.stringGroup, "")
|
||||||
}
|
}
|
||||||
if r.int64Group != nil {
|
if r.int64Group != nil {
|
||||||
localVarQueryParams.Add("int64_group", parameterToString(*r.int64Group, ""))
|
parameterAddToQuery(localVarQueryParams, "int64_group", r.int64Group, "")
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
@ -1609,9 +1609,9 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ
|
|||||||
if localVarHTTPHeaderAccept != "" {
|
if localVarHTTPHeaderAccept != "" {
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
localVarHeaderParams["required_boolean_group"] = parameterToString(*r.requiredBooleanGroup, "")
|
parameterAddToQuery(localVarQueryParams, "required_boolean_group", r.requiredBooleanGroup, "")
|
||||||
if r.booleanGroup != nil {
|
if r.booleanGroup != nil {
|
||||||
localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "")
|
parameterAddToQuery(localVarQueryParams, "boolean_group", r.booleanGroup, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1817,8 +1817,8 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (
|
|||||||
if localVarHTTPHeaderAccept != "" {
|
if localVarHTTPHeaderAccept != "" {
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("param", parameterToString(*r.param, ""))
|
parameterAddToQuery(localVarFormParams, "param", r.param, "")
|
||||||
localVarFormParams.Add("param2", parameterToString(*r.param2, ""))
|
parameterAddToQuery(localVarFormParams, "param2", r.param2, "")
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -1935,19 +1935,19 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer
|
|||||||
return nil, reportError("context is required and must be specified")
|
return nil, reportError("context is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("pipe", parameterToString(*r.pipe, "csv"))
|
parameterAddToQuery(localVarQueryParams, "pipe", r.pipe, "csv")
|
||||||
localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv"))
|
parameterAddToQuery(localVarQueryParams, "ioutil", r.ioutil, "csv")
|
||||||
localVarQueryParams.Add("http", parameterToString(*r.http, "ssv"))
|
parameterAddToQuery(localVarQueryParams, "http", r.http, "ssv")
|
||||||
localVarQueryParams.Add("url", parameterToString(*r.url, "csv"))
|
parameterAddToQuery(localVarQueryParams, "url", r.url, "csv")
|
||||||
{
|
{
|
||||||
t := *r.context
|
t := *r.context
|
||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi"))
|
parameterAddToQuery(localVarQueryParams, "context", s.Index(i), "multi")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("context", parameterToString(t, "multi"))
|
parameterAddToQuery(localVarQueryParams, "context", t, "multi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
|
@ -288,7 +288,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*http.Response,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}"
|
localVarPath := localBasePath + "/pet/{petId}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -312,7 +312,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*http.Response,
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.apiKey != nil {
|
if r.apiKey != nil {
|
||||||
localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "")
|
parameterAddToQuery(localVarQueryParams, "api_key", r.apiKey, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -397,7 +397,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([
|
|||||||
return localVarReturnValue, nil, reportError("status is required and must be specified")
|
return localVarReturnValue, nil, reportError("status is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("status", parameterToString(*r.status, "csv"))
|
parameterAddToQuery(localVarQueryParams, "status", r.status, "csv")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
@ -510,7 +510,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet
|
|||||||
return localVarReturnValue, nil, reportError("tags is required and must be specified")
|
return localVarReturnValue, nil, reportError("tags is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv"))
|
parameterAddToQuery(localVarQueryParams, "tags", r.tags, "csv")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
@ -608,7 +608,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (*Pet, *http.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}"
|
localVarPath := localBasePath + "/pet/{petId}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -833,7 +833,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}"
|
localVarPath := localBasePath + "/pet/{petId}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -857,10 +857,10 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest)
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.name != nil {
|
if r.name != nil {
|
||||||
localVarFormParams.Add("name", parameterToString(*r.name, ""))
|
parameterAddToQuery(localVarFormParams, "name", r.name, "")
|
||||||
}
|
}
|
||||||
if r.status != nil {
|
if r.status != nil {
|
||||||
localVarFormParams.Add("status", parameterToString(*r.status, ""))
|
parameterAddToQuery(localVarFormParams, "status", r.status, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -945,7 +945,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}/uploadImage"
|
localVarPath := localBasePath + "/pet/{petId}/uploadImage"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -969,7 +969,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse,
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.additionalMetadata != nil {
|
if r.additionalMetadata != nil {
|
||||||
localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, ""))
|
parameterAddToQuery(localVarFormParams, "additionalMetadata", r.additionalMetadata, "")
|
||||||
}
|
}
|
||||||
var fileLocalVarFormFileName string
|
var fileLocalVarFormFileName string
|
||||||
var fileLocalVarFileName string
|
var fileLocalVarFileName string
|
||||||
@ -1080,7 +1080,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile"
|
localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -1107,7 +1107,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.additionalMetadata != nil {
|
if r.additionalMetadata != nil {
|
||||||
localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, ""))
|
parameterAddToQuery(localVarFormParams, "additionalMetadata", r.additionalMetadata, "")
|
||||||
}
|
}
|
||||||
var requiredFileLocalVarFormFileName string
|
var requiredFileLocalVarFormFileName string
|
||||||
var requiredFileLocalVarFileName string
|
var requiredFileLocalVarFileName string
|
||||||
|
@ -122,7 +122,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*http.Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/store/order/{order_id}"
|
localVarPath := localBasePath + "/store/order/{order_id}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterValueToString(r.orderId, "orderId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -329,7 +329,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (*Order,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/store/order/{order_id}"
|
localVarPath := localBasePath + "/store/order/{order_id}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterValueToString(r.orderId, "orderId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
|
@ -462,7 +462,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respon
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/user/{username}"
|
localVarPath := localBasePath + "/user/{username}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -554,7 +554,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (*User,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/user/{username}"
|
localVarPath := localBasePath + "/user/{username}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -677,8 +677,8 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *http.
|
|||||||
return localVarReturnValue, nil, reportError("password is required and must be specified")
|
return localVarReturnValue, nil, reportError("password is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("username", parameterToString(*r.username, ""))
|
parameterAddToQuery(localVarQueryParams, "username", r.username, "")
|
||||||
localVarQueryParams.Add("password", parameterToString(*r.password, ""))
|
parameterAddToQuery(localVarQueryParams, "password", r.password, "")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
@ -867,7 +867,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*http.Respon
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/user/{username}"
|
localVarPath := localBasePath + "/user/{username}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
|
@ -39,6 +39,8 @@ import (
|
|||||||
var (
|
var (
|
||||||
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
||||||
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
||||||
|
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
|
||||||
|
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" )
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIClient manages communication with the OpenAPI Petstore API v1.0.0
|
// APIClient manages communication with the OpenAPI Petstore API v1.0.0
|
||||||
@ -140,28 +142,101 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
|
func parameterValueToString( obj interface{}, key string ) string {
|
||||||
func parameterToString(obj interface{}, collectionFormat string) string {
|
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
||||||
var delimiter string
|
|
||||||
|
|
||||||
switch collectionFormat {
|
|
||||||
case "pipes":
|
|
||||||
delimiter = "|"
|
|
||||||
case "ssv":
|
|
||||||
delimiter = " "
|
|
||||||
case "tsv":
|
|
||||||
delimiter = "\t"
|
|
||||||
case "csv":
|
|
||||||
delimiter = ","
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
return fmt.Sprintf("%v", obj)
|
||||||
|
}
|
||||||
|
var param,ok = obj.(MappedNullable)
|
||||||
|
if !ok {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
dataMap,err := param.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%v", dataMap[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
// parameterAddToQuery adds the provided object to the url query supporting deep object syntax
|
||||||
|
func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
|
||||||
|
var v = reflect.ValueOf(obj)
|
||||||
|
var value = ""
|
||||||
|
if v == reflect.ValueOf(nil) {
|
||||||
|
value = "null"
|
||||||
|
} else {
|
||||||
|
switch v.Kind() {
|
||||||
|
case reflect.Invalid:
|
||||||
|
value = "invalid"
|
||||||
|
|
||||||
|
case reflect.Struct:
|
||||||
|
if t,ok := obj.(MappedNullable); ok {
|
||||||
|
dataMap,err := t.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if t, ok := obj.(time.Time); ok {
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
case reflect.Slice:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var lenIndValue = indValue.Len()
|
||||||
|
for i:=0;i<lenIndValue;i++ {
|
||||||
|
var arrayValue = indValue.Index(i)
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, arrayValue.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Map:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
iter := indValue.MapRange()
|
||||||
|
for iter.Next() {
|
||||||
|
k,v := iter.Key(), iter.Value()
|
||||||
|
parameterAddToQuery(queryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Interface:
|
||||||
|
fallthrough
|
||||||
|
case reflect.Ptr:
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, v.Elem().Interface(), collectionType)
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||||
|
reflect.Int32, reflect.Int64:
|
||||||
|
value = strconv.FormatInt(v.Int(), 10)
|
||||||
|
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||||
|
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||||
|
value = strconv.FormatUint(v.Uint(), 10)
|
||||||
|
case reflect.Float32, reflect.Float64:
|
||||||
|
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||||
|
case reflect.Bool:
|
||||||
|
value = strconv.FormatBool(v.Bool())
|
||||||
|
case reflect.String:
|
||||||
|
value = v.String()
|
||||||
|
default:
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch valuesMap := queryParams.(type) {
|
||||||
|
case url.Values:
|
||||||
|
valuesMap.Add( keyPrefix, value )
|
||||||
|
break
|
||||||
|
case map[string]string:
|
||||||
|
valuesMap[keyPrefix] = value
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper for converting interface{} parameters to json strings
|
// helper for converting interface{} parameters to json strings
|
||||||
@ -313,7 +388,11 @@ func (c *APIClient) prepareRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Encode the parameters.
|
// Encode the parameters.
|
||||||
url.RawQuery = query.Encode()
|
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
||||||
|
pieces := strings.Split(s, "=")
|
||||||
|
pieces[0] = queryDescape.Replace(pieces[0])
|
||||||
|
return strings.Join(pieces, "=")
|
||||||
|
})
|
||||||
|
|
||||||
// Generate a new request
|
// Generate a new request
|
||||||
if body != nil {
|
if body != nil {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Model200Response type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Model200Response{}
|
||||||
|
|
||||||
// Model200Response Model for testing model name starting with number
|
// Model200Response Model for testing model name starting with number
|
||||||
type Model200Response struct {
|
type Model200Response struct {
|
||||||
Name *int32 `json:"name,omitempty"`
|
Name *int32 `json:"name,omitempty"`
|
||||||
@ -102,6 +105,14 @@ func (o *Model200Response) SetClass(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Model200Response) MarshalJSON() ([]byte, error) {
|
func (o Model200Response) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Model200Response) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
@ -109,7 +120,7 @@ func (o Model200Response) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Class) {
|
if !isNil(o.Class) {
|
||||||
toSerialize["class"] = o.Class
|
toSerialize["class"] = o.Class
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableModel200Response struct {
|
type NullableModel200Response struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesAnyType type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesAnyType{}
|
||||||
|
|
||||||
// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType
|
// AdditionalPropertiesAnyType struct for AdditionalPropertiesAnyType
|
||||||
type AdditionalPropertiesAnyType struct {
|
type AdditionalPropertiesAnyType struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesAnyType) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesAnyType) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesAnyType) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesAnyType struct {
|
type NullableAdditionalPropertiesAnyType struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesArray type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesArray{}
|
||||||
|
|
||||||
// AdditionalPropertiesArray struct for AdditionalPropertiesArray
|
// AdditionalPropertiesArray struct for AdditionalPropertiesArray
|
||||||
type AdditionalPropertiesArray struct {
|
type AdditionalPropertiesArray struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesArray) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesArray) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesArray) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesArray) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesArray struct {
|
type NullableAdditionalPropertiesArray struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesBoolean type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesBoolean{}
|
||||||
|
|
||||||
// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean
|
// AdditionalPropertiesBoolean struct for AdditionalPropertiesBoolean
|
||||||
type AdditionalPropertiesBoolean struct {
|
type AdditionalPropertiesBoolean struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesBoolean) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesBoolean) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesBoolean) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesBoolean struct {
|
type NullableAdditionalPropertiesBoolean struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesClass type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesClass{}
|
||||||
|
|
||||||
// AdditionalPropertiesClass struct for AdditionalPropertiesClass
|
// AdditionalPropertiesClass struct for AdditionalPropertiesClass
|
||||||
type AdditionalPropertiesClass struct {
|
type AdditionalPropertiesClass struct {
|
||||||
MapString *map[string]string `json:"map_string,omitempty"`
|
MapString *map[string]string `json:"map_string,omitempty"`
|
||||||
@ -399,6 +402,14 @@ func (o *AdditionalPropertiesClass) SetAnytype3(v map[string]interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesClass) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.MapString) {
|
if !isNil(o.MapString) {
|
||||||
toSerialize["map_string"] = o.MapString
|
toSerialize["map_string"] = o.MapString
|
||||||
@ -433,7 +444,7 @@ func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Anytype3) {
|
if !isNil(o.Anytype3) {
|
||||||
toSerialize["anytype_3"] = o.Anytype3
|
toSerialize["anytype_3"] = o.Anytype3
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesClass struct {
|
type NullableAdditionalPropertiesClass struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesInteger type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesInteger{}
|
||||||
|
|
||||||
// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger
|
// AdditionalPropertiesInteger struct for AdditionalPropertiesInteger
|
||||||
type AdditionalPropertiesInteger struct {
|
type AdditionalPropertiesInteger struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesInteger) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesInteger) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesInteger) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesInteger) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesInteger struct {
|
type NullableAdditionalPropertiesInteger struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesNumber type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesNumber{}
|
||||||
|
|
||||||
// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber
|
// AdditionalPropertiesNumber struct for AdditionalPropertiesNumber
|
||||||
type AdditionalPropertiesNumber struct {
|
type AdditionalPropertiesNumber struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesNumber) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesNumber) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesNumber) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesNumber) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesNumber struct {
|
type NullableAdditionalPropertiesNumber struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesObject type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesObject{}
|
||||||
|
|
||||||
// AdditionalPropertiesObject struct for AdditionalPropertiesObject
|
// AdditionalPropertiesObject struct for AdditionalPropertiesObject
|
||||||
type AdditionalPropertiesObject struct {
|
type AdditionalPropertiesObject struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesObject) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesObject) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesObject) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesObject) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesObject struct {
|
type NullableAdditionalPropertiesObject struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesString type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesString{}
|
||||||
|
|
||||||
// AdditionalPropertiesString struct for AdditionalPropertiesString
|
// AdditionalPropertiesString struct for AdditionalPropertiesString
|
||||||
type AdditionalPropertiesString struct {
|
type AdditionalPropertiesString struct {
|
||||||
Name *string `json:"name,omitempty"`
|
Name *string `json:"name,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *AdditionalPropertiesString) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesString) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesString) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesString) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAdditionalPropertiesString struct {
|
type NullableAdditionalPropertiesString struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Animal type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Animal{}
|
||||||
|
|
||||||
// Animal struct for Animal
|
// Animal struct for Animal
|
||||||
type Animal struct {
|
type Animal struct {
|
||||||
ClassName string `json:"className"`
|
ClassName string `json:"className"`
|
||||||
@ -99,14 +102,20 @@ func (o *Animal) SetColor(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Animal) MarshalJSON() ([]byte, error) {
|
func (o Animal) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["className"] = o.ClassName
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Animal) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["className"] = o.ClassName
|
||||||
if !isNil(o.Color) {
|
if !isNil(o.Color) {
|
||||||
toSerialize["color"] = o.Color
|
toSerialize["color"] = o.Color
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableAnimal struct {
|
type NullableAnimal struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ApiResponse type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ApiResponse{}
|
||||||
|
|
||||||
// ApiResponse struct for ApiResponse
|
// ApiResponse struct for ApiResponse
|
||||||
type ApiResponse struct {
|
type ApiResponse struct {
|
||||||
Code *int32 `json:"code,omitempty"`
|
Code *int32 `json:"code,omitempty"`
|
||||||
@ -135,6 +138,14 @@ func (o *ApiResponse) SetMessage(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ApiResponse) MarshalJSON() ([]byte, error) {
|
func (o ApiResponse) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ApiResponse) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Code) {
|
if !isNil(o.Code) {
|
||||||
toSerialize["code"] = o.Code
|
toSerialize["code"] = o.Code
|
||||||
@ -145,7 +156,7 @@ func (o ApiResponse) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Message) {
|
if !isNil(o.Message) {
|
||||||
toSerialize["message"] = o.Message
|
toSerialize["message"] = o.Message
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableApiResponse struct {
|
type NullableApiResponse struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ArrayOfArrayOfNumberOnly type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ArrayOfArrayOfNumberOnly{}
|
||||||
|
|
||||||
// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly
|
// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly
|
||||||
type ArrayOfArrayOfNumberOnly struct {
|
type ArrayOfArrayOfNumberOnly struct {
|
||||||
ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
|
ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ArrayOfArrayOfNumberOnly) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.ArrayArrayNumber) {
|
if !isNil(o.ArrayArrayNumber) {
|
||||||
toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber
|
toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableArrayOfArrayOfNumberOnly struct {
|
type NullableArrayOfArrayOfNumberOnly struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ArrayOfNumberOnly type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ArrayOfNumberOnly{}
|
||||||
|
|
||||||
// ArrayOfNumberOnly struct for ArrayOfNumberOnly
|
// ArrayOfNumberOnly struct for ArrayOfNumberOnly
|
||||||
type ArrayOfNumberOnly struct {
|
type ArrayOfNumberOnly struct {
|
||||||
ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
|
ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ArrayOfNumberOnly) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.ArrayNumber) {
|
if !isNil(o.ArrayNumber) {
|
||||||
toSerialize["ArrayNumber"] = o.ArrayNumber
|
toSerialize["ArrayNumber"] = o.ArrayNumber
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableArrayOfNumberOnly struct {
|
type NullableArrayOfNumberOnly struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ArrayTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ArrayTest{}
|
||||||
|
|
||||||
// ArrayTest struct for ArrayTest
|
// ArrayTest struct for ArrayTest
|
||||||
type ArrayTest struct {
|
type ArrayTest struct {
|
||||||
ArrayOfString []string `json:"array_of_string,omitempty"`
|
ArrayOfString []string `json:"array_of_string,omitempty"`
|
||||||
@ -135,6 +138,14 @@ func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ArrayTest) MarshalJSON() ([]byte, error) {
|
func (o ArrayTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ArrayTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.ArrayOfString) {
|
if !isNil(o.ArrayOfString) {
|
||||||
toSerialize["array_of_string"] = o.ArrayOfString
|
toSerialize["array_of_string"] = o.ArrayOfString
|
||||||
@ -145,7 +156,7 @@ func (o ArrayTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.ArrayArrayOfModel) {
|
if !isNil(o.ArrayArrayOfModel) {
|
||||||
toSerialize["array_array_of_model"] = o.ArrayArrayOfModel
|
toSerialize["array_array_of_model"] = o.ArrayArrayOfModel
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableArrayTest struct {
|
type NullableArrayTest struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the BigCat type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &BigCat{}
|
||||||
|
|
||||||
// BigCat struct for BigCat
|
// BigCat struct for BigCat
|
||||||
type BigCat struct {
|
type BigCat struct {
|
||||||
Cat
|
Cat
|
||||||
@ -73,19 +76,27 @@ func (o *BigCat) SetKind(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o BigCat) MarshalJSON() ([]byte, error) {
|
func (o BigCat) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o BigCat) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
serializedCat, errCat := json.Marshal(o.Cat)
|
serializedCat, errCat := json.Marshal(o.Cat)
|
||||||
if errCat != nil {
|
if errCat != nil {
|
||||||
return []byte{}, errCat
|
return map[string]interface{}{}, errCat
|
||||||
}
|
}
|
||||||
errCat = json.Unmarshal([]byte(serializedCat), &toSerialize)
|
errCat = json.Unmarshal([]byte(serializedCat), &toSerialize)
|
||||||
if errCat != nil {
|
if errCat != nil {
|
||||||
return []byte{}, errCat
|
return map[string]interface{}{}, errCat
|
||||||
}
|
}
|
||||||
if !isNil(o.Kind) {
|
if !isNil(o.Kind) {
|
||||||
toSerialize["kind"] = o.Kind
|
toSerialize["kind"] = o.Kind
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableBigCat struct {
|
type NullableBigCat struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the BigCatAllOf type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &BigCatAllOf{}
|
||||||
|
|
||||||
// BigCatAllOf struct for BigCatAllOf
|
// BigCatAllOf struct for BigCatAllOf
|
||||||
type BigCatAllOf struct {
|
type BigCatAllOf struct {
|
||||||
Kind *string `json:"kind,omitempty"`
|
Kind *string `json:"kind,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *BigCatAllOf) SetKind(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o BigCatAllOf) MarshalJSON() ([]byte, error) {
|
func (o BigCatAllOf) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o BigCatAllOf) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Kind) {
|
if !isNil(o.Kind) {
|
||||||
toSerialize["kind"] = o.Kind
|
toSerialize["kind"] = o.Kind
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableBigCatAllOf struct {
|
type NullableBigCatAllOf struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Capitalization type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Capitalization{}
|
||||||
|
|
||||||
// Capitalization struct for Capitalization
|
// Capitalization struct for Capitalization
|
||||||
type Capitalization struct {
|
type Capitalization struct {
|
||||||
SmallCamel *string `json:"smallCamel,omitempty"`
|
SmallCamel *string `json:"smallCamel,omitempty"`
|
||||||
@ -235,6 +238,14 @@ func (o *Capitalization) SetATT_NAME(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Capitalization) MarshalJSON() ([]byte, error) {
|
func (o Capitalization) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Capitalization) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.SmallCamel) {
|
if !isNil(o.SmallCamel) {
|
||||||
toSerialize["smallCamel"] = o.SmallCamel
|
toSerialize["smallCamel"] = o.SmallCamel
|
||||||
@ -254,7 +265,7 @@ func (o Capitalization) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.ATT_NAME) {
|
if !isNil(o.ATT_NAME) {
|
||||||
toSerialize["ATT_NAME"] = o.ATT_NAME
|
toSerialize["ATT_NAME"] = o.ATT_NAME
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableCapitalization struct {
|
type NullableCapitalization struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Cat type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Cat{}
|
||||||
|
|
||||||
// Cat struct for Cat
|
// Cat struct for Cat
|
||||||
type Cat struct {
|
type Cat struct {
|
||||||
Animal
|
Animal
|
||||||
@ -73,19 +76,27 @@ func (o *Cat) SetDeclawed(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Cat) MarshalJSON() ([]byte, error) {
|
func (o Cat) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Cat) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
if !isNil(o.Declawed) {
|
if !isNil(o.Declawed) {
|
||||||
toSerialize["declawed"] = o.Declawed
|
toSerialize["declawed"] = o.Declawed
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableCat struct {
|
type NullableCat struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the CatAllOf type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &CatAllOf{}
|
||||||
|
|
||||||
// CatAllOf struct for CatAllOf
|
// CatAllOf struct for CatAllOf
|
||||||
type CatAllOf struct {
|
type CatAllOf struct {
|
||||||
Declawed *bool `json:"declawed,omitempty"`
|
Declawed *bool `json:"declawed,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *CatAllOf) SetDeclawed(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o CatAllOf) MarshalJSON() ([]byte, error) {
|
func (o CatAllOf) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o CatAllOf) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Declawed) {
|
if !isNil(o.Declawed) {
|
||||||
toSerialize["declawed"] = o.Declawed
|
toSerialize["declawed"] = o.Declawed
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableCatAllOf struct {
|
type NullableCatAllOf struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Category type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Category{}
|
||||||
|
|
||||||
// Category struct for Category
|
// Category struct for Category
|
||||||
type Category struct {
|
type Category struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty"`
|
||||||
@ -97,14 +100,20 @@ func (o *Category) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Category) MarshalJSON() ([]byte, error) {
|
func (o Category) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Category) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Id) {
|
if !isNil(o.Id) {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
return toSerialize, nil
|
||||||
return json.Marshal(toSerialize)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableCategory struct {
|
type NullableCategory struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ClassModel type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ClassModel{}
|
||||||
|
|
||||||
// ClassModel Model for testing model with \"_class\" property
|
// ClassModel Model for testing model with \"_class\" property
|
||||||
type ClassModel struct {
|
type ClassModel struct {
|
||||||
Class *string `json:"_class,omitempty"`
|
Class *string `json:"_class,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *ClassModel) SetClass(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ClassModel) MarshalJSON() ([]byte, error) {
|
func (o ClassModel) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ClassModel) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Class) {
|
if !isNil(o.Class) {
|
||||||
toSerialize["_class"] = o.Class
|
toSerialize["_class"] = o.Class
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableClassModel struct {
|
type NullableClassModel struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Client type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Client{}
|
||||||
|
|
||||||
// Client struct for Client
|
// Client struct for Client
|
||||||
type Client struct {
|
type Client struct {
|
||||||
Client *string `json:"client,omitempty"`
|
Client *string `json:"client,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *Client) SetClient(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Client) MarshalJSON() ([]byte, error) {
|
func (o Client) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Client) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Client) {
|
if !isNil(o.Client) {
|
||||||
toSerialize["client"] = o.Client
|
toSerialize["client"] = o.Client
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableClient struct {
|
type NullableClient struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Dog type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Dog{}
|
||||||
|
|
||||||
// Dog struct for Dog
|
// Dog struct for Dog
|
||||||
type Dog struct {
|
type Dog struct {
|
||||||
Animal
|
Animal
|
||||||
@ -73,19 +76,27 @@ func (o *Dog) SetBreed(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Dog) MarshalJSON() ([]byte, error) {
|
func (o Dog) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Dog) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
if !isNil(o.Breed) {
|
if !isNil(o.Breed) {
|
||||||
toSerialize["breed"] = o.Breed
|
toSerialize["breed"] = o.Breed
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableDog struct {
|
type NullableDog struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the DogAllOf type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &DogAllOf{}
|
||||||
|
|
||||||
// DogAllOf struct for DogAllOf
|
// DogAllOf struct for DogAllOf
|
||||||
type DogAllOf struct {
|
type DogAllOf struct {
|
||||||
Breed *string `json:"breed,omitempty"`
|
Breed *string `json:"breed,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *DogAllOf) SetBreed(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o DogAllOf) MarshalJSON() ([]byte, error) {
|
func (o DogAllOf) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o DogAllOf) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Breed) {
|
if !isNil(o.Breed) {
|
||||||
toSerialize["breed"] = o.Breed
|
toSerialize["breed"] = o.Breed
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableDogAllOf struct {
|
type NullableDogAllOf struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the EnumArrays type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &EnumArrays{}
|
||||||
|
|
||||||
// EnumArrays struct for EnumArrays
|
// EnumArrays struct for EnumArrays
|
||||||
type EnumArrays struct {
|
type EnumArrays struct {
|
||||||
JustSymbol *string `json:"just_symbol,omitempty"`
|
JustSymbol *string `json:"just_symbol,omitempty"`
|
||||||
@ -102,6 +105,14 @@ func (o *EnumArrays) SetArrayEnum(v []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o EnumArrays) MarshalJSON() ([]byte, error) {
|
func (o EnumArrays) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o EnumArrays) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.JustSymbol) {
|
if !isNil(o.JustSymbol) {
|
||||||
toSerialize["just_symbol"] = o.JustSymbol
|
toSerialize["just_symbol"] = o.JustSymbol
|
||||||
@ -109,7 +120,7 @@ func (o EnumArrays) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.ArrayEnum) {
|
if !isNil(o.ArrayEnum) {
|
||||||
toSerialize["array_enum"] = o.ArrayEnum
|
toSerialize["array_enum"] = o.ArrayEnum
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableEnumArrays struct {
|
type NullableEnumArrays struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the EnumTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &EnumTest{}
|
||||||
|
|
||||||
// EnumTest struct for EnumTest
|
// EnumTest struct for EnumTest
|
||||||
type EnumTest struct {
|
type EnumTest struct {
|
||||||
EnumString *string `json:"enum_string,omitempty"`
|
EnumString *string `json:"enum_string,omitempty"`
|
||||||
@ -194,13 +197,19 @@ func (o *EnumTest) SetOuterEnum(v OuterEnum) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o EnumTest) MarshalJSON() ([]byte, error) {
|
func (o EnumTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o EnumTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.EnumString) {
|
if !isNil(o.EnumString) {
|
||||||
toSerialize["enum_string"] = o.EnumString
|
toSerialize["enum_string"] = o.EnumString
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["enum_string_required"] = o.EnumStringRequired
|
toSerialize["enum_string_required"] = o.EnumStringRequired
|
||||||
}
|
|
||||||
if !isNil(o.EnumInteger) {
|
if !isNil(o.EnumInteger) {
|
||||||
toSerialize["enum_integer"] = o.EnumInteger
|
toSerialize["enum_integer"] = o.EnumInteger
|
||||||
}
|
}
|
||||||
@ -210,7 +219,7 @@ func (o EnumTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.OuterEnum) {
|
if !isNil(o.OuterEnum) {
|
||||||
toSerialize["outerEnum"] = o.OuterEnum
|
toSerialize["outerEnum"] = o.OuterEnum
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableEnumTest struct {
|
type NullableEnumTest struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the File type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &File{}
|
||||||
|
|
||||||
// File Must be named `File` for test.
|
// File Must be named `File` for test.
|
||||||
type File struct {
|
type File struct {
|
||||||
// Test capitalization
|
// Test capitalization
|
||||||
@ -70,11 +73,19 @@ func (o *File) SetSourceURI(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o File) MarshalJSON() ([]byte, error) {
|
func (o File) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o File) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.SourceURI) {
|
if !isNil(o.SourceURI) {
|
||||||
toSerialize["sourceURI"] = o.SourceURI
|
toSerialize["sourceURI"] = o.SourceURI
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableFile struct {
|
type NullableFile struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the FileSchemaTestClass type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &FileSchemaTestClass{}
|
||||||
|
|
||||||
// FileSchemaTestClass struct for FileSchemaTestClass
|
// FileSchemaTestClass struct for FileSchemaTestClass
|
||||||
type FileSchemaTestClass struct {
|
type FileSchemaTestClass struct {
|
||||||
File *File `json:"file,omitempty"`
|
File *File `json:"file,omitempty"`
|
||||||
@ -102,6 +105,14 @@ func (o *FileSchemaTestClass) SetFiles(v []File) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) {
|
func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o FileSchemaTestClass) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.File) {
|
if !isNil(o.File) {
|
||||||
toSerialize["file"] = o.File
|
toSerialize["file"] = o.File
|
||||||
@ -109,7 +120,7 @@ func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Files) {
|
if !isNil(o.Files) {
|
||||||
toSerialize["files"] = o.Files
|
toSerialize["files"] = o.Files
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableFileSchemaTestClass struct {
|
type NullableFileSchemaTestClass struct {
|
||||||
|
@ -16,6 +16,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the FormatTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &FormatTest{}
|
||||||
|
|
||||||
// FormatTest struct for FormatTest
|
// FormatTest struct for FormatTest
|
||||||
type FormatTest struct {
|
type FormatTest struct {
|
||||||
Integer *int32 `json:"integer,omitempty"`
|
Integer *int32 `json:"integer,omitempty"`
|
||||||
@ -472,6 +475,14 @@ func (o *FormatTest) SetBigDecimal(v float64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o FormatTest) MarshalJSON() ([]byte, error) {
|
func (o FormatTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o FormatTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Integer) {
|
if !isNil(o.Integer) {
|
||||||
toSerialize["integer"] = o.Integer
|
toSerialize["integer"] = o.Integer
|
||||||
@ -482,9 +493,7 @@ func (o FormatTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Int64) {
|
if !isNil(o.Int64) {
|
||||||
toSerialize["int64"] = o.Int64
|
toSerialize["int64"] = o.Int64
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["number"] = o.Number
|
toSerialize["number"] = o.Number
|
||||||
}
|
|
||||||
if !isNil(o.Float) {
|
if !isNil(o.Float) {
|
||||||
toSerialize["float"] = o.Float
|
toSerialize["float"] = o.Float
|
||||||
}
|
}
|
||||||
@ -494,28 +503,22 @@ func (o FormatTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.String) {
|
if !isNil(o.String) {
|
||||||
toSerialize["string"] = o.String
|
toSerialize["string"] = o.String
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["byte"] = o.Byte
|
toSerialize["byte"] = o.Byte
|
||||||
}
|
|
||||||
if !isNil(o.Binary) {
|
if !isNil(o.Binary) {
|
||||||
toSerialize["binary"] = o.Binary
|
toSerialize["binary"] = o.Binary
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["date"] = o.Date
|
toSerialize["date"] = o.Date
|
||||||
}
|
|
||||||
if !isNil(o.DateTime) {
|
if !isNil(o.DateTime) {
|
||||||
toSerialize["dateTime"] = o.DateTime
|
toSerialize["dateTime"] = o.DateTime
|
||||||
}
|
}
|
||||||
if !isNil(o.Uuid) {
|
if !isNil(o.Uuid) {
|
||||||
toSerialize["uuid"] = o.Uuid
|
toSerialize["uuid"] = o.Uuid
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["password"] = o.Password
|
toSerialize["password"] = o.Password
|
||||||
}
|
|
||||||
if !isNil(o.BigDecimal) {
|
if !isNil(o.BigDecimal) {
|
||||||
toSerialize["BigDecimal"] = o.BigDecimal
|
toSerialize["BigDecimal"] = o.BigDecimal
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableFormatTest struct {
|
type NullableFormatTest struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the HasOnlyReadOnly type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &HasOnlyReadOnly{}
|
||||||
|
|
||||||
// HasOnlyReadOnly struct for HasOnlyReadOnly
|
// HasOnlyReadOnly struct for HasOnlyReadOnly
|
||||||
type HasOnlyReadOnly struct {
|
type HasOnlyReadOnly struct {
|
||||||
Bar *string `json:"bar,omitempty"`
|
Bar *string `json:"bar,omitempty"`
|
||||||
@ -102,6 +105,14 @@ func (o *HasOnlyReadOnly) SetFoo(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) {
|
func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o HasOnlyReadOnly) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Bar) {
|
if !isNil(o.Bar) {
|
||||||
toSerialize["bar"] = o.Bar
|
toSerialize["bar"] = o.Bar
|
||||||
@ -109,7 +120,7 @@ func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Foo) {
|
if !isNil(o.Foo) {
|
||||||
toSerialize["foo"] = o.Foo
|
toSerialize["foo"] = o.Foo
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableHasOnlyReadOnly struct {
|
type NullableHasOnlyReadOnly struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the List type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &List{}
|
||||||
|
|
||||||
// List struct for List
|
// List struct for List
|
||||||
type List struct {
|
type List struct {
|
||||||
Var123List *string `json:"123-list,omitempty"`
|
Var123List *string `json:"123-list,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *List) SetVar123List(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o List) MarshalJSON() ([]byte, error) {
|
func (o List) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o List) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Var123List) {
|
if !isNil(o.Var123List) {
|
||||||
toSerialize["123-list"] = o.Var123List
|
toSerialize["123-list"] = o.Var123List
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableList struct {
|
type NullableList struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the MapTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &MapTest{}
|
||||||
|
|
||||||
// MapTest struct for MapTest
|
// MapTest struct for MapTest
|
||||||
type MapTest struct {
|
type MapTest struct {
|
||||||
MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"`
|
MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"`
|
||||||
@ -168,6 +171,14 @@ func (o *MapTest) SetIndirectMap(v map[string]bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o MapTest) MarshalJSON() ([]byte, error) {
|
func (o MapTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o MapTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.MapMapOfString) {
|
if !isNil(o.MapMapOfString) {
|
||||||
toSerialize["map_map_of_string"] = o.MapMapOfString
|
toSerialize["map_map_of_string"] = o.MapMapOfString
|
||||||
@ -181,7 +192,7 @@ func (o MapTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.IndirectMap) {
|
if !isNil(o.IndirectMap) {
|
||||||
toSerialize["indirect_map"] = o.IndirectMap
|
toSerialize["indirect_map"] = o.IndirectMap
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableMapTest struct {
|
type NullableMapTest struct {
|
||||||
|
@ -15,6 +15,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the MixedPropertiesAndAdditionalPropertiesClass type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &MixedPropertiesAndAdditionalPropertiesClass{}
|
||||||
|
|
||||||
// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass
|
// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass
|
||||||
type MixedPropertiesAndAdditionalPropertiesClass struct {
|
type MixedPropertiesAndAdditionalPropertiesClass struct {
|
||||||
Uuid *string `json:"uuid,omitempty"`
|
Uuid *string `json:"uuid,omitempty"`
|
||||||
@ -136,6 +139,14 @@ func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o MixedPropertiesAndAdditionalPropertiesClass) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Uuid) {
|
if !isNil(o.Uuid) {
|
||||||
toSerialize["uuid"] = o.Uuid
|
toSerialize["uuid"] = o.Uuid
|
||||||
@ -146,7 +157,7 @@ func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, erro
|
|||||||
if !isNil(o.Map) {
|
if !isNil(o.Map) {
|
||||||
toSerialize["map"] = o.Map
|
toSerialize["map"] = o.Map
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableMixedPropertiesAndAdditionalPropertiesClass struct {
|
type NullableMixedPropertiesAndAdditionalPropertiesClass struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Name type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Name{}
|
||||||
|
|
||||||
// Name Model for testing model name same as property name
|
// Name Model for testing model name same as property name
|
||||||
type Name struct {
|
type Name struct {
|
||||||
Name int32 `json:"name"`
|
Name int32 `json:"name"`
|
||||||
@ -161,10 +164,16 @@ func (o *Name) SetVar123Number(v int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Name) MarshalJSON() ([]byte, error) {
|
func (o Name) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["name"] = o.Name
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Name) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["name"] = o.Name
|
||||||
if !isNil(o.SnakeCase) {
|
if !isNil(o.SnakeCase) {
|
||||||
toSerialize["snake_case"] = o.SnakeCase
|
toSerialize["snake_case"] = o.SnakeCase
|
||||||
}
|
}
|
||||||
@ -174,7 +183,7 @@ func (o Name) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Var123Number) {
|
if !isNil(o.Var123Number) {
|
||||||
toSerialize["123Number"] = o.Var123Number
|
toSerialize["123Number"] = o.Var123Number
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableName struct {
|
type NullableName struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the NumberOnly type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &NumberOnly{}
|
||||||
|
|
||||||
// NumberOnly struct for NumberOnly
|
// NumberOnly struct for NumberOnly
|
||||||
type NumberOnly struct {
|
type NumberOnly struct {
|
||||||
JustNumber *float32 `json:"JustNumber,omitempty"`
|
JustNumber *float32 `json:"JustNumber,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *NumberOnly) SetJustNumber(v float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o NumberOnly) MarshalJSON() ([]byte, error) {
|
func (o NumberOnly) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o NumberOnly) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.JustNumber) {
|
if !isNil(o.JustNumber) {
|
||||||
toSerialize["JustNumber"] = o.JustNumber
|
toSerialize["JustNumber"] = o.JustNumber
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableNumberOnly struct {
|
type NullableNumberOnly struct {
|
||||||
|
@ -15,6 +15,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Order type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Order{}
|
||||||
|
|
||||||
// Order struct for Order
|
// Order struct for Order
|
||||||
type Order struct {
|
type Order struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty"`
|
||||||
@ -240,6 +243,14 @@ func (o *Order) SetComplete(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Order) MarshalJSON() ([]byte, error) {
|
func (o Order) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Order) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Id) {
|
if !isNil(o.Id) {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
@ -259,7 +270,7 @@ func (o Order) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Complete) {
|
if !isNil(o.Complete) {
|
||||||
toSerialize["complete"] = o.Complete
|
toSerialize["complete"] = o.Complete
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableOrder struct {
|
type NullableOrder struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the OuterComposite type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &OuterComposite{}
|
||||||
|
|
||||||
// OuterComposite struct for OuterComposite
|
// OuterComposite struct for OuterComposite
|
||||||
type OuterComposite struct {
|
type OuterComposite struct {
|
||||||
MyNumber *float32 `json:"my_number,omitempty"`
|
MyNumber *float32 `json:"my_number,omitempty"`
|
||||||
@ -135,6 +138,14 @@ func (o *OuterComposite) SetMyBoolean(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o OuterComposite) MarshalJSON() ([]byte, error) {
|
func (o OuterComposite) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o OuterComposite) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.MyNumber) {
|
if !isNil(o.MyNumber) {
|
||||||
toSerialize["my_number"] = o.MyNumber
|
toSerialize["my_number"] = o.MyNumber
|
||||||
@ -145,7 +156,7 @@ func (o OuterComposite) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.MyBoolean) {
|
if !isNil(o.MyBoolean) {
|
||||||
toSerialize["my_boolean"] = o.MyBoolean
|
toSerialize["my_boolean"] = o.MyBoolean
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableOuterComposite struct {
|
type NullableOuterComposite struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Pet type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Pet{}
|
||||||
|
|
||||||
// Pet struct for Pet
|
// Pet struct for Pet
|
||||||
type Pet struct {
|
type Pet struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty"`
|
||||||
@ -221,6 +224,14 @@ func (o *Pet) SetStatus(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Pet) MarshalJSON() ([]byte, error) {
|
func (o Pet) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Pet) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Id) {
|
if !isNil(o.Id) {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
@ -228,19 +239,15 @@ func (o Pet) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Category) {
|
if !isNil(o.Category) {
|
||||||
toSerialize["category"] = o.Category
|
toSerialize["category"] = o.Category
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["photoUrls"] = o.PhotoUrls
|
toSerialize["photoUrls"] = o.PhotoUrls
|
||||||
}
|
|
||||||
if !isNil(o.Tags) {
|
if !isNil(o.Tags) {
|
||||||
toSerialize["tags"] = o.Tags
|
toSerialize["tags"] = o.Tags
|
||||||
}
|
}
|
||||||
if !isNil(o.Status) {
|
if !isNil(o.Status) {
|
||||||
toSerialize["status"] = o.Status
|
toSerialize["status"] = o.Status
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullablePet struct {
|
type NullablePet struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ReadOnlyFirst type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ReadOnlyFirst{}
|
||||||
|
|
||||||
// ReadOnlyFirst struct for ReadOnlyFirst
|
// ReadOnlyFirst struct for ReadOnlyFirst
|
||||||
type ReadOnlyFirst struct {
|
type ReadOnlyFirst struct {
|
||||||
Bar *string `json:"bar,omitempty"`
|
Bar *string `json:"bar,omitempty"`
|
||||||
@ -102,6 +105,14 @@ func (o *ReadOnlyFirst) SetBaz(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) {
|
func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ReadOnlyFirst) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Bar) {
|
if !isNil(o.Bar) {
|
||||||
toSerialize["bar"] = o.Bar
|
toSerialize["bar"] = o.Bar
|
||||||
@ -109,7 +120,7 @@ func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Baz) {
|
if !isNil(o.Baz) {
|
||||||
toSerialize["baz"] = o.Baz
|
toSerialize["baz"] = o.Baz
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableReadOnlyFirst struct {
|
type NullableReadOnlyFirst struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Return type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Return{}
|
||||||
|
|
||||||
// Return Model for testing reserved words
|
// Return Model for testing reserved words
|
||||||
type Return struct {
|
type Return struct {
|
||||||
Return *int32 `json:"return,omitempty"`
|
Return *int32 `json:"return,omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *Return) SetReturn(v int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Return) MarshalJSON() ([]byte, error) {
|
func (o Return) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Return) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Return) {
|
if !isNil(o.Return) {
|
||||||
toSerialize["return"] = o.Return
|
toSerialize["return"] = o.Return
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableReturn struct {
|
type NullableReturn struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the SpecialModelName type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &SpecialModelName{}
|
||||||
|
|
||||||
// SpecialModelName struct for SpecialModelName
|
// SpecialModelName struct for SpecialModelName
|
||||||
type SpecialModelName struct {
|
type SpecialModelName struct {
|
||||||
SpecialPropertyName *int64 `json:"$special[property.name],omitempty"`
|
SpecialPropertyName *int64 `json:"$special[property.name],omitempty"`
|
||||||
@ -69,11 +72,19 @@ func (o *SpecialModelName) SetSpecialPropertyName(v int64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o SpecialModelName) MarshalJSON() ([]byte, error) {
|
func (o SpecialModelName) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o SpecialModelName) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.SpecialPropertyName) {
|
if !isNil(o.SpecialPropertyName) {
|
||||||
toSerialize["$special[property.name]"] = o.SpecialPropertyName
|
toSerialize["$special[property.name]"] = o.SpecialPropertyName
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableSpecialModelName struct {
|
type NullableSpecialModelName struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Tag type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Tag{}
|
||||||
|
|
||||||
// Tag struct for Tag
|
// Tag struct for Tag
|
||||||
type Tag struct {
|
type Tag struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty"`
|
||||||
@ -102,6 +105,14 @@ func (o *Tag) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Tag) MarshalJSON() ([]byte, error) {
|
func (o Tag) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Tag) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Id) {
|
if !isNil(o.Id) {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
@ -109,7 +120,7 @@ func (o Tag) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableTag struct {
|
type NullableTag struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the TypeHolderDefault type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &TypeHolderDefault{}
|
||||||
|
|
||||||
// TypeHolderDefault struct for TypeHolderDefault
|
// TypeHolderDefault struct for TypeHolderDefault
|
||||||
type TypeHolderDefault struct {
|
type TypeHolderDefault struct {
|
||||||
StringItem string `json:"string_item"`
|
StringItem string `json:"string_item"`
|
||||||
@ -170,25 +173,23 @@ func (o *TypeHolderDefault) SetArrayItem(v []int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o TypeHolderDefault) MarshalJSON() ([]byte, error) {
|
func (o TypeHolderDefault) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["string_item"] = o.StringItem
|
return []byte{}, err
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["number_item"] = o.NumberItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["integer_item"] = o.IntegerItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["bool_item"] = o.BoolItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["array_item"] = o.ArrayItem
|
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return json.Marshal(toSerialize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o TypeHolderDefault) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["string_item"] = o.StringItem
|
||||||
|
toSerialize["number_item"] = o.NumberItem
|
||||||
|
toSerialize["integer_item"] = o.IntegerItem
|
||||||
|
toSerialize["bool_item"] = o.BoolItem
|
||||||
|
toSerialize["array_item"] = o.ArrayItem
|
||||||
|
return toSerialize, nil
|
||||||
|
}
|
||||||
|
|
||||||
type NullableTypeHolderDefault struct {
|
type NullableTypeHolderDefault struct {
|
||||||
value *TypeHolderDefault
|
value *TypeHolderDefault
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the TypeHolderExample type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &TypeHolderExample{}
|
||||||
|
|
||||||
// TypeHolderExample struct for TypeHolderExample
|
// TypeHolderExample struct for TypeHolderExample
|
||||||
type TypeHolderExample struct {
|
type TypeHolderExample struct {
|
||||||
StringItem string `json:"string_item"`
|
StringItem string `json:"string_item"`
|
||||||
@ -192,28 +195,24 @@ func (o *TypeHolderExample) SetArrayItem(v []int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o TypeHolderExample) MarshalJSON() ([]byte, error) {
|
func (o TypeHolderExample) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["string_item"] = o.StringItem
|
return []byte{}, err
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["number_item"] = o.NumberItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["float_item"] = o.FloatItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["integer_item"] = o.IntegerItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["bool_item"] = o.BoolItem
|
|
||||||
}
|
|
||||||
if true {
|
|
||||||
toSerialize["array_item"] = o.ArrayItem
|
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return json.Marshal(toSerialize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (o TypeHolderExample) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["string_item"] = o.StringItem
|
||||||
|
toSerialize["number_item"] = o.NumberItem
|
||||||
|
toSerialize["float_item"] = o.FloatItem
|
||||||
|
toSerialize["integer_item"] = o.IntegerItem
|
||||||
|
toSerialize["bool_item"] = o.BoolItem
|
||||||
|
toSerialize["array_item"] = o.ArrayItem
|
||||||
|
return toSerialize, nil
|
||||||
|
}
|
||||||
|
|
||||||
type NullableTypeHolderExample struct {
|
type NullableTypeHolderExample struct {
|
||||||
value *TypeHolderExample
|
value *TypeHolderExample
|
||||||
isSet bool
|
isSet bool
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the User type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &User{}
|
||||||
|
|
||||||
// User struct for User
|
// User struct for User
|
||||||
type User struct {
|
type User struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty"`
|
||||||
@ -301,6 +304,14 @@ func (o *User) SetUserStatus(v int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o User) MarshalJSON() ([]byte, error) {
|
func (o User) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o User) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Id) {
|
if !isNil(o.Id) {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
@ -326,7 +337,7 @@ func (o User) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.UserStatus) {
|
if !isNil(o.UserStatus) {
|
||||||
toSerialize["userStatus"] = o.UserStatus
|
toSerialize["userStatus"] = o.UserStatus
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableUser struct {
|
type NullableUser struct {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the XmlItem type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &XmlItem{}
|
||||||
|
|
||||||
// XmlItem struct for XmlItem
|
// XmlItem struct for XmlItem
|
||||||
type XmlItem struct {
|
type XmlItem struct {
|
||||||
AttributeString *string `json:"attribute_string,omitempty"`
|
AttributeString *string `json:"attribute_string,omitempty"`
|
||||||
@ -993,6 +996,14 @@ func (o *XmlItem) SetPrefixNsWrappedArray(v []int32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o XmlItem) MarshalJSON() ([]byte, error) {
|
func (o XmlItem) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o XmlItem) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.AttributeString) {
|
if !isNil(o.AttributeString) {
|
||||||
toSerialize["attribute_string"] = o.AttributeString
|
toSerialize["attribute_string"] = o.AttributeString
|
||||||
@ -1081,7 +1092,7 @@ func (o XmlItem) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.PrefixNsWrappedArray) {
|
if !isNil(o.PrefixNsWrappedArray) {
|
||||||
toSerialize["prefix_ns_wrapped_array"] = o.PrefixNsWrappedArray
|
toSerialize["prefix_ns_wrapped_array"] = o.PrefixNsWrappedArray
|
||||||
}
|
}
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type NullableXmlItem struct {
|
type NullableXmlItem struct {
|
||||||
|
@ -341,3 +341,7 @@ func isNil(i interface{}) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MappedNullable interface {
|
||||||
|
ToMap() (map[string]interface{}, error)
|
||||||
|
}
|
||||||
|
@ -111,7 +111,7 @@ func TestFindPetsByTag(t *testing.T) {
|
|||||||
assert := assert.New(t)
|
assert := assert.New(t)
|
||||||
for i := 0; i < len(resp); i++ {
|
for i := 0; i < len(resp); i++ {
|
||||||
if *resp[i].Id == 12830 {
|
if *resp[i].Id == 12830 {
|
||||||
assert.Equal(*resp[i].Status, "available", "Pet status should be `pending`")
|
assert.Equal("available", *resp[i].Status, "Pet status should be `available`")
|
||||||
found = true
|
found = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ func TestPlaceOrder(t *testing.T) {
|
|||||||
// Skip parsing time error due to error in Petstore Test Server
|
// Skip parsing time error due to error in Petstore Test Server
|
||||||
// https://github.com/OpenAPITools/openapi-generator/issues/1292
|
// https://github.com/OpenAPITools/openapi-generator/issues/1292
|
||||||
if regexp.
|
if regexp.
|
||||||
MustCompile(`^parsing time.+cannot parse "\+0000"" as "Z07:00"$`).
|
MustCompile(`as "Z07:00"$`).
|
||||||
MatchString(err.Error()) {
|
MatchString(err.Error()) {
|
||||||
t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime")
|
t.Log("Skipping error for parsing time with `+0000` UTC offset as Petstore Test Server does not return valid RFC 3339 datetime")
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,6 +39,8 @@ import (
|
|||||||
var (
|
var (
|
||||||
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
||||||
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
||||||
|
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
|
||||||
|
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" )
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIClient manages communication with the OpenAPI Extension x-auth-id-alias API v1.0.0
|
// APIClient manages communication with the OpenAPI Extension x-auth-id-alias API v1.0.0
|
||||||
@ -125,28 +127,101 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
|
func parameterValueToString( obj interface{}, key string ) string {
|
||||||
func parameterToString(obj interface{}, collectionFormat string) string {
|
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
||||||
var delimiter string
|
|
||||||
|
|
||||||
switch collectionFormat {
|
|
||||||
case "pipes":
|
|
||||||
delimiter = "|"
|
|
||||||
case "ssv":
|
|
||||||
delimiter = " "
|
|
||||||
case "tsv":
|
|
||||||
delimiter = "\t"
|
|
||||||
case "csv":
|
|
||||||
delimiter = ","
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
return fmt.Sprintf("%v", obj)
|
||||||
|
}
|
||||||
|
var param,ok = obj.(MappedNullable)
|
||||||
|
if !ok {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
dataMap,err := param.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%v", dataMap[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
// parameterAddToQuery adds the provided object to the url query supporting deep object syntax
|
||||||
|
func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
|
||||||
|
var v = reflect.ValueOf(obj)
|
||||||
|
var value = ""
|
||||||
|
if v == reflect.ValueOf(nil) {
|
||||||
|
value = "null"
|
||||||
|
} else {
|
||||||
|
switch v.Kind() {
|
||||||
|
case reflect.Invalid:
|
||||||
|
value = "invalid"
|
||||||
|
|
||||||
|
case reflect.Struct:
|
||||||
|
if t,ok := obj.(MappedNullable); ok {
|
||||||
|
dataMap,err := t.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if t, ok := obj.(time.Time); ok {
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
case reflect.Slice:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var lenIndValue = indValue.Len()
|
||||||
|
for i:=0;i<lenIndValue;i++ {
|
||||||
|
var arrayValue = indValue.Index(i)
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, arrayValue.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Map:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
iter := indValue.MapRange()
|
||||||
|
for iter.Next() {
|
||||||
|
k,v := iter.Key(), iter.Value()
|
||||||
|
parameterAddToQuery(queryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Interface:
|
||||||
|
fallthrough
|
||||||
|
case reflect.Ptr:
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, v.Elem().Interface(), collectionType)
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||||
|
reflect.Int32, reflect.Int64:
|
||||||
|
value = strconv.FormatInt(v.Int(), 10)
|
||||||
|
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||||
|
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||||
|
value = strconv.FormatUint(v.Uint(), 10)
|
||||||
|
case reflect.Float32, reflect.Float64:
|
||||||
|
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||||
|
case reflect.Bool:
|
||||||
|
value = strconv.FormatBool(v.Bool())
|
||||||
|
case reflect.String:
|
||||||
|
value = v.String()
|
||||||
|
default:
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch valuesMap := queryParams.(type) {
|
||||||
|
case url.Values:
|
||||||
|
valuesMap.Add( keyPrefix, value )
|
||||||
|
break
|
||||||
|
case map[string]string:
|
||||||
|
valuesMap[keyPrefix] = value
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper for converting interface{} parameters to json strings
|
// helper for converting interface{} parameters to json strings
|
||||||
@ -298,7 +373,11 @@ func (c *APIClient) prepareRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Encode the parameters.
|
// Encode the parameters.
|
||||||
url.RawQuery = query.Encode()
|
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
||||||
|
pieces := strings.Split(s, "=")
|
||||||
|
pieces[0] = queryDescape.Replace(pieces[0])
|
||||||
|
return strings.Join(pieces, "=")
|
||||||
|
})
|
||||||
|
|
||||||
// Generate a new request
|
// Generate a new request
|
||||||
if body != nil {
|
if body != nil {
|
||||||
|
@ -341,3 +341,7 @@ func isNil(i interface{}) bool {
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MappedNullable interface {
|
||||||
|
ToMap() (map[string]interface{}, error)
|
||||||
|
}
|
||||||
|
@ -2,11 +2,16 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"github.com/stretchr/testify/assert"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
sw "go-petstore"
|
sw "go-petstore"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
deepObjectURL = `/v2/fake/deep_object_test?inputOptions[F1]=1&inputOptions[F2]=teststring&inputOptions[F3]=null&inputOptions[id]=1&inputOptions[name]=TestCat&test_pet[F1]=1&test_pet[F2]=teststring&test_pet[F3]=null&test_pet[id]=1&test_pet[name]=Test&test_pet[photoUrls]=http%3A%2F%2Flocalhost&test_pet[tags][F1]=1&test_pet[tags][F2]=teststring&test_pet[tags][F3]=null&test_pet[tags][id]=2&test_pet[tags][name]=tag1`
|
||||||
|
)
|
||||||
|
|
||||||
// TestPutBodyWithFileSchema ensures a model with the name 'File'
|
// TestPutBodyWithFileSchema ensures a model with the name 'File'
|
||||||
// gets converted properly to the petstore.File struct vs. *os.File
|
// gets converted properly to the petstore.File struct vs. *os.File
|
||||||
// as specified in typeMapping for 'File'.
|
// as specified in typeMapping for 'File'.
|
||||||
@ -26,3 +31,50 @@ func TestPutBodyWithFileSchema(t *testing.T) {
|
|||||||
t.Log(r)
|
t.Log(r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestQueryDeepObject(t *testing.T) {
|
||||||
|
req := client.FakeApi.TestQueryDeepObject(context.Background())
|
||||||
|
|
||||||
|
var id = int64(1)
|
||||||
|
var idTag1 = int64(2)
|
||||||
|
var nameTag1 = "tag1"
|
||||||
|
req = req.TestPet(sw.Pet{
|
||||||
|
Id: &id,
|
||||||
|
Name: "Test",
|
||||||
|
PhotoUrls: []string{ "http://localhost" },
|
||||||
|
Tags: []sw.Tag{
|
||||||
|
{
|
||||||
|
Id: &idTag1,
|
||||||
|
Name: &nameTag1,
|
||||||
|
AdditionalProperties: map[string]interface{}{
|
||||||
|
"F1": 1,
|
||||||
|
"F2": "teststring",
|
||||||
|
"F3": nil,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
AdditionalProperties: map[string]interface{}{
|
||||||
|
"F1": 1,
|
||||||
|
"F2": "teststring",
|
||||||
|
"F3": nil,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
var idcat = int64(1)
|
||||||
|
req = req.InputOptions(sw.Category{
|
||||||
|
Id: &idcat,
|
||||||
|
Name: "TestCat",
|
||||||
|
AdditionalProperties: map[string]interface{}{
|
||||||
|
"F1": 1,
|
||||||
|
"F2": "teststring",
|
||||||
|
"F3": nil,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
r, _ := req.Execute()
|
||||||
|
|
||||||
|
var expectedDeepObjectURL = testScheme + "://" + testHost + deepObjectURL
|
||||||
|
|
||||||
|
assert.Equal(t,
|
||||||
|
expectedDeepObjectURL,
|
||||||
|
r.Request.URL.String() )
|
||||||
|
}
|
||||||
|
@ -93,6 +93,7 @@ Class | Method | HTTP request | Description
|
|||||||
*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional)
|
*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional)
|
||||||
*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties
|
*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties
|
||||||
*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data
|
*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data
|
||||||
|
*FakeApi* | [**TestQueryDeepObject**](docs/FakeApi.md#testquerydeepobject) | **Get** /fake/deep_object_test |
|
||||||
*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-parameters |
|
*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-parameters |
|
||||||
*FakeApi* | [**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](docs/FakeApi.md#testuniqueitemsheaderandqueryparametercollectionformat) | **Put** /fake/test-unique-parameters |
|
*FakeApi* | [**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](docs/FakeApi.md#testuniqueitemsheaderandqueryparametercollectionformat) | **Put** /fake/test-unique-parameters |
|
||||||
*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case
|
*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case
|
||||||
|
@ -669,7 +669,7 @@ paths:
|
|||||||
description: Something wrong
|
description: Something wrong
|
||||||
"5XX":
|
"5XX":
|
||||||
content:
|
content:
|
||||||
applicatino/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/OuterNumber'
|
$ref: '#/components/schemas/OuterNumber'
|
||||||
description: Something wrong
|
description: Something wrong
|
||||||
@ -1116,6 +1116,29 @@ paths:
|
|||||||
summary: Health check endpoint
|
summary: Health check endpoint
|
||||||
tags:
|
tags:
|
||||||
- fake
|
- fake
|
||||||
|
/fake/deep_object_test:
|
||||||
|
get:
|
||||||
|
operationId: test_query_deep_object
|
||||||
|
parameters:
|
||||||
|
- explode: true
|
||||||
|
in: query
|
||||||
|
name: test_pet
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Pet'
|
||||||
|
style: deepObject
|
||||||
|
- explode: true
|
||||||
|
in: query
|
||||||
|
name: inputOptions
|
||||||
|
required: false
|
||||||
|
schema:
|
||||||
|
$ref: '#/components/schemas/Category'
|
||||||
|
style: deepObject
|
||||||
|
responses:
|
||||||
|
"200":
|
||||||
|
description: OK
|
||||||
|
tags:
|
||||||
|
- fake
|
||||||
components:
|
components:
|
||||||
requestBodies:
|
requestBodies:
|
||||||
UserArray:
|
UserArray:
|
||||||
|
@ -199,6 +199,17 @@ type FakeApi interface {
|
|||||||
// TestJsonFormDataExecute executes the request
|
// TestJsonFormDataExecute executes the request
|
||||||
TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*http.Response, error)
|
TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (*http.Response, error)
|
||||||
|
|
||||||
|
/*
|
||||||
|
TestQueryDeepObject Method for TestQueryDeepObject
|
||||||
|
|
||||||
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
@return ApiTestQueryDeepObjectRequest
|
||||||
|
*/
|
||||||
|
TestQueryDeepObject(ctx context.Context) ApiTestQueryDeepObjectRequest
|
||||||
|
|
||||||
|
// TestQueryDeepObjectExecute executes the request
|
||||||
|
TestQueryDeepObjectExecute(r ApiTestQueryDeepObjectRequest) (*http.Response, error)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
|
TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat
|
||||||
|
|
||||||
@ -917,7 +928,7 @@ func (a *FakeApiService) TestBodyWithQueryParamsExecute(r ApiTestBodyWithQueryPa
|
|||||||
return nil, reportError("user is required and must be specified")
|
return nil, reportError("user is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("query", parameterToString(*r.query, ""))
|
parameterAddToQuery(localVarQueryParams, "query", r.query, "")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{"application/json"}
|
localVarHTTPContentTypes := []string{"application/json"}
|
||||||
|
|
||||||
@ -1263,24 +1274,24 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.integer != nil {
|
if r.integer != nil {
|
||||||
localVarFormParams.Add("integer", parameterToString(*r.integer, ""))
|
parameterAddToQuery(localVarFormParams, "integer", r.integer, "")
|
||||||
}
|
}
|
||||||
if r.int32_ != nil {
|
if r.int32_ != nil {
|
||||||
localVarFormParams.Add("int32", parameterToString(*r.int32_, ""))
|
parameterAddToQuery(localVarFormParams, "int32", r.int32_, "")
|
||||||
}
|
}
|
||||||
if r.int64_ != nil {
|
if r.int64_ != nil {
|
||||||
localVarFormParams.Add("int64", parameterToString(*r.int64_, ""))
|
parameterAddToQuery(localVarFormParams, "int64", r.int64_, "")
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("number", parameterToString(*r.number, ""))
|
parameterAddToQuery(localVarFormParams, "number", r.number, "")
|
||||||
if r.float != nil {
|
if r.float != nil {
|
||||||
localVarFormParams.Add("float", parameterToString(*r.float, ""))
|
parameterAddToQuery(localVarFormParams, "float", r.float, "")
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("double", parameterToString(*r.double, ""))
|
parameterAddToQuery(localVarFormParams, "double", r.double, "")
|
||||||
if r.string_ != nil {
|
if r.string_ != nil {
|
||||||
localVarFormParams.Add("string", parameterToString(*r.string_, ""))
|
parameterAddToQuery(localVarFormParams, "string", r.string_, "")
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("pattern_without_delimiter", parameterToString(*r.patternWithoutDelimiter, ""))
|
parameterAddToQuery(localVarFormParams, "pattern_without_delimiter", r.patternWithoutDelimiter, "")
|
||||||
localVarFormParams.Add("byte", parameterToString(*r.byte_, ""))
|
parameterAddToQuery(localVarFormParams, "byte", r.byte_, "")
|
||||||
var binaryLocalVarFormFileName string
|
var binaryLocalVarFormFileName string
|
||||||
var binaryLocalVarFileName string
|
var binaryLocalVarFileName string
|
||||||
var binaryLocalVarFileBytes []byte
|
var binaryLocalVarFileBytes []byte
|
||||||
@ -1299,16 +1310,16 @@ func (a *FakeApiService) TestEndpointParametersExecute(r ApiTestEndpointParamete
|
|||||||
}
|
}
|
||||||
formFiles = append(formFiles, formFile{fileBytes: binaryLocalVarFileBytes, fileName: binaryLocalVarFileName, formFileName: binaryLocalVarFormFileName})
|
formFiles = append(formFiles, formFile{fileBytes: binaryLocalVarFileBytes, fileName: binaryLocalVarFileName, formFileName: binaryLocalVarFormFileName})
|
||||||
if r.date != nil {
|
if r.date != nil {
|
||||||
localVarFormParams.Add("date", parameterToString(*r.date, ""))
|
parameterAddToQuery(localVarFormParams, "date", r.date, "")
|
||||||
}
|
}
|
||||||
if r.dateTime != nil {
|
if r.dateTime != nil {
|
||||||
localVarFormParams.Add("dateTime", parameterToString(*r.dateTime, ""))
|
parameterAddToQuery(localVarFormParams, "dateTime", r.dateTime, "")
|
||||||
}
|
}
|
||||||
if r.password != nil {
|
if r.password != nil {
|
||||||
localVarFormParams.Add("password", parameterToString(*r.password, ""))
|
parameterAddToQuery(localVarFormParams, "password", r.password, "")
|
||||||
}
|
}
|
||||||
if r.callback != nil {
|
if r.callback != nil {
|
||||||
localVarFormParams.Add("callback", parameterToString(*r.callback, ""))
|
parameterAddToQuery(localVarFormParams, "callback", r.callback, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1442,20 +1453,20 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques
|
|||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("enum_query_string_array", parameterToString(s.Index(i), "multi"))
|
parameterAddToQuery(localVarQueryParams, "enum_query_string_array", s.Index(i), "multi")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("enum_query_string_array", parameterToString(t, "multi"))
|
parameterAddToQuery(localVarQueryParams, "enum_query_string_array", t, "multi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if r.enumQueryString != nil {
|
if r.enumQueryString != nil {
|
||||||
localVarQueryParams.Add("enum_query_string", parameterToString(*r.enumQueryString, ""))
|
parameterAddToQuery(localVarQueryParams, "enum_query_string", r.enumQueryString, "")
|
||||||
}
|
}
|
||||||
if r.enumQueryInteger != nil {
|
if r.enumQueryInteger != nil {
|
||||||
localVarQueryParams.Add("enum_query_integer", parameterToString(*r.enumQueryInteger, ""))
|
parameterAddToQuery(localVarQueryParams, "enum_query_integer", r.enumQueryInteger, "")
|
||||||
}
|
}
|
||||||
if r.enumQueryDouble != nil {
|
if r.enumQueryDouble != nil {
|
||||||
localVarQueryParams.Add("enum_query_double", parameterToString(*r.enumQueryDouble, ""))
|
parameterAddToQuery(localVarQueryParams, "enum_query_double", r.enumQueryDouble, "")
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"}
|
localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||||
@ -1475,16 +1486,16 @@ func (a *FakeApiService) TestEnumParametersExecute(r ApiTestEnumParametersReques
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.enumHeaderStringArray != nil {
|
if r.enumHeaderStringArray != nil {
|
||||||
localVarHeaderParams["enum_header_string_array"] = parameterToString(*r.enumHeaderStringArray, "csv")
|
parameterAddToQuery(localVarQueryParams, "enum_header_string_array", r.enumHeaderStringArray, "csv")
|
||||||
}
|
}
|
||||||
if r.enumHeaderString != nil {
|
if r.enumHeaderString != nil {
|
||||||
localVarHeaderParams["enum_header_string"] = parameterToString(*r.enumHeaderString, "")
|
parameterAddToQuery(localVarQueryParams, "enum_header_string", r.enumHeaderString, "")
|
||||||
}
|
}
|
||||||
if r.enumFormStringArray != nil {
|
if r.enumFormStringArray != nil {
|
||||||
localVarFormParams.Add("enum_form_string_array", parameterToString(*r.enumFormStringArray, "csv"))
|
parameterAddToQuery(localVarFormParams, "enum_form_string_array", r.enumFormStringArray, "csv")
|
||||||
}
|
}
|
||||||
if r.enumFormString != nil {
|
if r.enumFormString != nil {
|
||||||
localVarFormParams.Add("enum_form_string", parameterToString(*r.enumFormString, ""))
|
parameterAddToQuery(localVarFormParams, "enum_form_string", r.enumFormString, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1608,13 +1619,13 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ
|
|||||||
return nil, reportError("requiredInt64Group is required and must be specified")
|
return nil, reportError("requiredInt64Group is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("required_string_group", parameterToString(*r.requiredStringGroup, ""))
|
parameterAddToQuery(localVarQueryParams, "required_string_group", r.requiredStringGroup, "")
|
||||||
localVarQueryParams.Add("required_int64_group", parameterToString(*r.requiredInt64Group, ""))
|
parameterAddToQuery(localVarQueryParams, "required_int64_group", r.requiredInt64Group, "")
|
||||||
if r.stringGroup != nil {
|
if r.stringGroup != nil {
|
||||||
localVarQueryParams.Add("string_group", parameterToString(*r.stringGroup, ""))
|
parameterAddToQuery(localVarQueryParams, "string_group", r.stringGroup, "")
|
||||||
}
|
}
|
||||||
if r.int64Group != nil {
|
if r.int64Group != nil {
|
||||||
localVarQueryParams.Add("int64_group", parameterToString(*r.int64Group, ""))
|
parameterAddToQuery(localVarQueryParams, "int64_group", r.int64Group, "")
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
@ -1626,16 +1637,16 @@ func (a *FakeApiService) TestGroupParametersExecute(r ApiTestGroupParametersRequ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// to determine the Accept header
|
// to determine the Accept header
|
||||||
localVarHTTPHeaderAccepts := []string{"applicatino/json"}
|
localVarHTTPHeaderAccepts := []string{"application/json"}
|
||||||
|
|
||||||
// set Accept header
|
// set Accept header
|
||||||
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||||
if localVarHTTPHeaderAccept != "" {
|
if localVarHTTPHeaderAccept != "" {
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
localVarHeaderParams["required_boolean_group"] = parameterToString(*r.requiredBooleanGroup, "")
|
parameterAddToQuery(localVarQueryParams, "required_boolean_group", r.requiredBooleanGroup, "")
|
||||||
if r.booleanGroup != nil {
|
if r.booleanGroup != nil {
|
||||||
localVarHeaderParams["boolean_group"] = parameterToString(*r.booleanGroup, "")
|
parameterAddToQuery(localVarQueryParams, "boolean_group", r.booleanGroup, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1855,8 +1866,112 @@ func (a *FakeApiService) TestJsonFormDataExecute(r ApiTestJsonFormDataRequest) (
|
|||||||
if localVarHTTPHeaderAccept != "" {
|
if localVarHTTPHeaderAccept != "" {
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
localVarFormParams.Add("param", parameterToString(*r.param, ""))
|
parameterAddToQuery(localVarFormParams, "param", r.param, "")
|
||||||
localVarFormParams.Add("param2", parameterToString(*r.param2, ""))
|
parameterAddToQuery(localVarFormParams, "param2", r.param2, "")
|
||||||
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarHTTPResponse, err := a.client.callAPI(req)
|
||||||
|
if err != nil || localVarHTTPResponse == nil {
|
||||||
|
return localVarHTTPResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarBody, err := ioutil.ReadAll(localVarHTTPResponse.Body)
|
||||||
|
localVarHTTPResponse.Body.Close()
|
||||||
|
localVarHTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(localVarBody))
|
||||||
|
if err != nil {
|
||||||
|
return localVarHTTPResponse, err
|
||||||
|
}
|
||||||
|
|
||||||
|
if localVarHTTPResponse.StatusCode >= 300 {
|
||||||
|
newErr := &GenericOpenAPIError{
|
||||||
|
body: localVarBody,
|
||||||
|
error: localVarHTTPResponse.Status,
|
||||||
|
}
|
||||||
|
return localVarHTTPResponse, newErr
|
||||||
|
}
|
||||||
|
|
||||||
|
return localVarHTTPResponse, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
type ApiTestQueryDeepObjectRequest struct {
|
||||||
|
ctx context.Context
|
||||||
|
ApiService FakeApi
|
||||||
|
testPet *Pet
|
||||||
|
inputOptions *Category
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r ApiTestQueryDeepObjectRequest) TestPet(testPet Pet) ApiTestQueryDeepObjectRequest {
|
||||||
|
r.testPet = &testPet
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r ApiTestQueryDeepObjectRequest) InputOptions(inputOptions Category) ApiTestQueryDeepObjectRequest {
|
||||||
|
r.inputOptions = &inputOptions
|
||||||
|
return r
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r ApiTestQueryDeepObjectRequest) Execute() (*http.Response, error) {
|
||||||
|
return r.ApiService.TestQueryDeepObjectExecute(r)
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
TestQueryDeepObject Method for TestQueryDeepObject
|
||||||
|
|
||||||
|
@param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||||
|
@return ApiTestQueryDeepObjectRequest
|
||||||
|
*/
|
||||||
|
func (a *FakeApiService) TestQueryDeepObject(ctx context.Context) ApiTestQueryDeepObjectRequest {
|
||||||
|
return ApiTestQueryDeepObjectRequest{
|
||||||
|
ApiService: a,
|
||||||
|
ctx: ctx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execute executes the request
|
||||||
|
func (a *FakeApiService) TestQueryDeepObjectExecute(r ApiTestQueryDeepObjectRequest) (*http.Response, error) {
|
||||||
|
var (
|
||||||
|
localVarHTTPMethod = http.MethodGet
|
||||||
|
localVarPostBody interface{}
|
||||||
|
formFiles []formFile
|
||||||
|
)
|
||||||
|
|
||||||
|
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "FakeApiService.TestQueryDeepObject")
|
||||||
|
if err != nil {
|
||||||
|
return nil, &GenericOpenAPIError{error: err.Error()}
|
||||||
|
}
|
||||||
|
|
||||||
|
localVarPath := localBasePath + "/fake/deep_object_test"
|
||||||
|
|
||||||
|
localVarHeaderParams := make(map[string]string)
|
||||||
|
localVarQueryParams := url.Values{}
|
||||||
|
localVarFormParams := url.Values{}
|
||||||
|
|
||||||
|
if r.testPet != nil {
|
||||||
|
parameterAddToQuery(localVarQueryParams, "test_pet", r.testPet, "")
|
||||||
|
}
|
||||||
|
if r.inputOptions != nil {
|
||||||
|
parameterAddToQuery(localVarQueryParams, "inputOptions", r.inputOptions, "")
|
||||||
|
}
|
||||||
|
// to determine the Content-Type header
|
||||||
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
|
// set Content-Type header
|
||||||
|
localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)
|
||||||
|
if localVarHTTPContentType != "" {
|
||||||
|
localVarHeaderParams["Content-Type"] = localVarHTTPContentType
|
||||||
|
}
|
||||||
|
|
||||||
|
// to determine the Accept header
|
||||||
|
localVarHTTPHeaderAccepts := []string{}
|
||||||
|
|
||||||
|
// set Accept header
|
||||||
|
localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)
|
||||||
|
if localVarHTTPHeaderAccept != "" {
|
||||||
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -1978,24 +2093,24 @@ func (a *FakeApiService) TestQueryParameterCollectionFormatExecute(r ApiTestQuer
|
|||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi"))
|
parameterAddToQuery(localVarQueryParams, "pipe", s.Index(i), "multi")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("pipe", parameterToString(t, "multi"))
|
parameterAddToQuery(localVarQueryParams, "pipe", t, "multi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
localVarQueryParams.Add("ioutil", parameterToString(*r.ioutil, "csv"))
|
parameterAddToQuery(localVarQueryParams, "ioutil", r.ioutil, "csv")
|
||||||
localVarQueryParams.Add("http", parameterToString(*r.http, "ssv"))
|
parameterAddToQuery(localVarQueryParams, "http", r.http, "ssv")
|
||||||
localVarQueryParams.Add("url", parameterToString(*r.url, "csv"))
|
parameterAddToQuery(localVarQueryParams, "url", r.url, "csv")
|
||||||
{
|
{
|
||||||
t := *r.context
|
t := *r.context
|
||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi"))
|
parameterAddToQuery(localVarQueryParams, "context", s.Index(i), "multi")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("context", parameterToString(t, "multi"))
|
parameterAddToQuery(localVarQueryParams, "context", t, "multi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
@ -2111,10 +2226,10 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE
|
|||||||
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
if reflect.TypeOf(t).Kind() == reflect.Slice {
|
||||||
s := reflect.ValueOf(t)
|
s := reflect.ValueOf(t)
|
||||||
for i := 0; i < s.Len(); i++ {
|
for i := 0; i < s.Len(); i++ {
|
||||||
localVarQueryParams.Add("queryUnique", parameterToString(s.Index(i), "multi"))
|
parameterAddToQuery(localVarQueryParams, "queryUnique", s.Index(i), "multi")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
localVarQueryParams.Add("queryUnique", parameterToString(t, "multi"))
|
parameterAddToQuery(localVarQueryParams, "queryUnique", t, "multi")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
@ -2134,7 +2249,7 @@ func (a *FakeApiService) TestUniqueItemsHeaderAndQueryParameterCollectionFormatE
|
|||||||
if localVarHTTPHeaderAccept != "" {
|
if localVarHTTPHeaderAccept != "" {
|
||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
localVarHeaderParams["headerUnique"] = parameterToString(*r.headerUnique, "csv")
|
parameterAddToQuery(localVarQueryParams, "headerUnique", r.headerUnique, "csv")
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return localVarReturnValue, nil, err
|
return localVarReturnValue, nil, err
|
||||||
|
@ -304,7 +304,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*http.Response,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}"
|
localVarPath := localBasePath + "/pet/{petId}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -328,7 +328,7 @@ func (a *PetApiService) DeletePetExecute(r ApiDeletePetRequest) (*http.Response,
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.apiKey != nil {
|
if r.apiKey != nil {
|
||||||
localVarHeaderParams["api_key"] = parameterToString(*r.apiKey, "")
|
parameterAddToQuery(localVarQueryParams, "api_key", r.apiKey, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -414,7 +414,7 @@ func (a *PetApiService) FindPetsByStatusExecute(r ApiFindPetsByStatusRequest) ([
|
|||||||
return localVarReturnValue, nil, reportError("status is required and must be specified")
|
return localVarReturnValue, nil, reportError("status is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("status", parameterToString(*r.status, "csv"))
|
parameterAddToQuery(localVarQueryParams, "status", r.status, "csv")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
@ -527,7 +527,7 @@ func (a *PetApiService) FindPetsByTagsExecute(r ApiFindPetsByTagsRequest) ([]Pet
|
|||||||
return localVarReturnValue, nil, reportError("tags is required and must be specified")
|
return localVarReturnValue, nil, reportError("tags is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("tags", parameterToString(*r.tags, "csv"))
|
parameterAddToQuery(localVarQueryParams, "tags", r.tags, "csv")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
@ -625,7 +625,7 @@ func (a *PetApiService) GetPetByIdExecute(r ApiGetPetByIdRequest) (*Pet, *http.R
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}"
|
localVarPath := localBasePath + "/pet/{petId}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -854,7 +854,7 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}"
|
localVarPath := localBasePath + "/pet/{petId}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -878,10 +878,10 @@ func (a *PetApiService) UpdatePetWithFormExecute(r ApiUpdatePetWithFormRequest)
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.name != nil {
|
if r.name != nil {
|
||||||
localVarFormParams.Add("name", parameterToString(*r.name, ""))
|
parameterAddToQuery(localVarFormParams, "name", r.name, "")
|
||||||
}
|
}
|
||||||
if r.status != nil {
|
if r.status != nil {
|
||||||
localVarFormParams.Add("status", parameterToString(*r.status, ""))
|
parameterAddToQuery(localVarFormParams, "status", r.status, "")
|
||||||
}
|
}
|
||||||
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -968,7 +968,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/pet/{petId}/uploadImage"
|
localVarPath := localBasePath + "/pet/{petId}/uploadImage"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -992,7 +992,7 @@ func (a *PetApiService) UploadFileExecute(r ApiUploadFileRequest) (*ApiResponse,
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.additionalMetadata != nil {
|
if r.additionalMetadata != nil {
|
||||||
localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, ""))
|
parameterAddToQuery(localVarFormParams, "additionalMetadata", r.additionalMetadata, "")
|
||||||
}
|
}
|
||||||
var fileLocalVarFormFileName string
|
var fileLocalVarFormFileName string
|
||||||
var fileLocalVarFileName string
|
var fileLocalVarFileName string
|
||||||
@ -1105,7 +1105,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile"
|
localVarPath := localBasePath + "/fake/{petId}/uploadImageWithRequiredFile"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterToString(r.petId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", url.PathEscape(parameterValueToString(r.petId, "petId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -1132,7 +1132,7 @@ func (a *PetApiService) UploadFileWithRequiredFileExecute(r ApiUploadFileWithReq
|
|||||||
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept
|
||||||
}
|
}
|
||||||
if r.additionalMetadata != nil {
|
if r.additionalMetadata != nil {
|
||||||
localVarFormParams.Add("additionalMetadata", parameterToString(*r.additionalMetadata, ""))
|
parameterAddToQuery(localVarFormParams, "additionalMetadata", r.additionalMetadata, "")
|
||||||
}
|
}
|
||||||
var requiredFileLocalVarFormFileName string
|
var requiredFileLocalVarFormFileName string
|
||||||
var requiredFileLocalVarFileName string
|
var requiredFileLocalVarFileName string
|
||||||
|
@ -124,7 +124,7 @@ func (a *StoreApiService) DeleteOrderExecute(r ApiDeleteOrderRequest) (*http.Res
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/store/order/{order_id}"
|
localVarPath := localBasePath + "/store/order/{order_id}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterValueToString(r.orderId, "orderId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -331,7 +331,7 @@ func (a *StoreApiService) GetOrderByIdExecute(r ApiGetOrderByIdRequest) (*Order,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/store/order/{order_id}"
|
localVarPath := localBasePath + "/store/order/{order_id}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterToString(r.orderId, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", url.PathEscape(parameterValueToString(r.orderId, "orderId")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
|
@ -476,7 +476,7 @@ func (a *UserApiService) DeleteUserExecute(r ApiDeleteUserRequest) (*http.Respon
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/user/{username}"
|
localVarPath := localBasePath + "/user/{username}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -570,7 +570,7 @@ func (a *UserApiService) GetUserByNameExecute(r ApiGetUserByNameRequest) (*User,
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/user/{username}"
|
localVarPath := localBasePath + "/user/{username}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
@ -695,8 +695,8 @@ func (a *UserApiService) LoginUserExecute(r ApiLoginUserRequest) (string, *http.
|
|||||||
return localVarReturnValue, nil, reportError("password is required and must be specified")
|
return localVarReturnValue, nil, reportError("password is required and must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
localVarQueryParams.Add("username", parameterToString(*r.username, ""))
|
parameterAddToQuery(localVarQueryParams, "username", r.username, "")
|
||||||
localVarQueryParams.Add("password", parameterToString(*r.password, ""))
|
parameterAddToQuery(localVarQueryParams, "password", r.password, "")
|
||||||
// to determine the Content-Type header
|
// to determine the Content-Type header
|
||||||
localVarHTTPContentTypes := []string{}
|
localVarHTTPContentTypes := []string{}
|
||||||
|
|
||||||
@ -887,7 +887,7 @@ func (a *UserApiService) UpdateUserExecute(r ApiUpdateUserRequest) (*http.Respon
|
|||||||
}
|
}
|
||||||
|
|
||||||
localVarPath := localBasePath + "/user/{username}"
|
localVarPath := localBasePath + "/user/{username}"
|
||||||
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterToString(r.username, "")), -1)
|
localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", url.PathEscape(parameterValueToString(r.username, "username")), -1)
|
||||||
|
|
||||||
localVarHeaderParams := make(map[string]string)
|
localVarHeaderParams := make(map[string]string)
|
||||||
localVarQueryParams := url.Values{}
|
localVarQueryParams := url.Values{}
|
||||||
|
@ -39,6 +39,8 @@ import (
|
|||||||
var (
|
var (
|
||||||
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`)
|
||||||
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`)
|
||||||
|
queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`)
|
||||||
|
queryDescape = strings.NewReplacer( "%5B", "[", "%5D", "]" )
|
||||||
)
|
)
|
||||||
|
|
||||||
// APIClient manages communication with the OpenAPI Petstore API v1.0.0
|
// APIClient manages communication with the OpenAPI Petstore API v1.0.0
|
||||||
@ -143,28 +145,101 @@ func typeCheckParameter(obj interface{}, expected string, name string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// parameterToString convert interface{} parameters to string, using a delimiter if format is provided.
|
func parameterValueToString( obj interface{}, key string ) string {
|
||||||
func parameterToString(obj interface{}, collectionFormat string) string {
|
if reflect.TypeOf(obj).Kind() != reflect.Ptr {
|
||||||
var delimiter string
|
|
||||||
|
|
||||||
switch collectionFormat {
|
|
||||||
case "pipes":
|
|
||||||
delimiter = "|"
|
|
||||||
case "ssv":
|
|
||||||
delimiter = " "
|
|
||||||
case "tsv":
|
|
||||||
delimiter = "\t"
|
|
||||||
case "csv":
|
|
||||||
delimiter = ","
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
return fmt.Sprintf("%v", obj)
|
||||||
|
}
|
||||||
|
var param,ok = obj.(MappedNullable)
|
||||||
|
if !ok {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
dataMap,err := param.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
return fmt.Sprintf("%v", dataMap[key])
|
||||||
|
}
|
||||||
|
|
||||||
|
// parameterAddToQuery adds the provided object to the url query supporting deep object syntax
|
||||||
|
func parameterAddToQuery(queryParams interface{}, keyPrefix string, obj interface{}, collectionType string) {
|
||||||
|
var v = reflect.ValueOf(obj)
|
||||||
|
var value = ""
|
||||||
|
if v == reflect.ValueOf(nil) {
|
||||||
|
value = "null"
|
||||||
|
} else {
|
||||||
|
switch v.Kind() {
|
||||||
|
case reflect.Invalid:
|
||||||
|
value = "invalid"
|
||||||
|
|
||||||
|
case reflect.Struct:
|
||||||
|
if t,ok := obj.(MappedNullable); ok {
|
||||||
|
dataMap,err := t.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, dataMap, collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if t, ok := obj.(time.Time); ok {
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, t.Format(time.RFC3339), collectionType)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
case reflect.Slice:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
var lenIndValue = indValue.Len()
|
||||||
|
for i:=0;i<lenIndValue;i++ {
|
||||||
|
var arrayValue = indValue.Index(i)
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, arrayValue.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Map:
|
||||||
|
var indValue = reflect.ValueOf(obj)
|
||||||
|
if indValue == reflect.ValueOf(nil) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
iter := indValue.MapRange()
|
||||||
|
for iter.Next() {
|
||||||
|
k,v := iter.Key(), iter.Value()
|
||||||
|
parameterAddToQuery(queryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType)
|
||||||
|
}
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Interface:
|
||||||
|
fallthrough
|
||||||
|
case reflect.Ptr:
|
||||||
|
parameterAddToQuery(queryParams, keyPrefix, v.Elem().Interface(), collectionType)
|
||||||
|
return
|
||||||
|
|
||||||
|
case reflect.Int, reflect.Int8, reflect.Int16,
|
||||||
|
reflect.Int32, reflect.Int64:
|
||||||
|
value = strconv.FormatInt(v.Int(), 10)
|
||||||
|
case reflect.Uint, reflect.Uint8, reflect.Uint16,
|
||||||
|
reflect.Uint32, reflect.Uint64, reflect.Uintptr:
|
||||||
|
value = strconv.FormatUint(v.Uint(), 10)
|
||||||
|
case reflect.Float32, reflect.Float64:
|
||||||
|
value = strconv.FormatFloat(v.Float(), 'g', -1, 32)
|
||||||
|
case reflect.Bool:
|
||||||
|
value = strconv.FormatBool(v.Bool())
|
||||||
|
case reflect.String:
|
||||||
|
value = v.String()
|
||||||
|
default:
|
||||||
|
value = v.Type().String() + " value"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch valuesMap := queryParams.(type) {
|
||||||
|
case url.Values:
|
||||||
|
valuesMap.Add( keyPrefix, value )
|
||||||
|
break
|
||||||
|
case map[string]string:
|
||||||
|
valuesMap[keyPrefix] = value
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// helper for converting interface{} parameters to json strings
|
// helper for converting interface{} parameters to json strings
|
||||||
@ -316,7 +391,11 @@ func (c *APIClient) prepareRequest(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Encode the parameters.
|
// Encode the parameters.
|
||||||
url.RawQuery = query.Encode()
|
url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string {
|
||||||
|
pieces := strings.Split(s, "=")
|
||||||
|
pieces[0] = queryDescape.Replace(pieces[0])
|
||||||
|
return strings.Join(pieces, "=")
|
||||||
|
})
|
||||||
|
|
||||||
// Generate a new request
|
// Generate a new request
|
||||||
if body != nil {
|
if body != nil {
|
||||||
|
@ -17,6 +17,7 @@ Method | HTTP request | Description
|
|||||||
[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional)
|
[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional)
|
||||||
[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties
|
[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties
|
||||||
[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data
|
[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data
|
||||||
|
[**TestQueryDeepObject**](FakeApi.md#TestQueryDeepObject) | **Get** /fake/deep_object_test |
|
||||||
[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-parameters |
|
[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-parameters |
|
||||||
[**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](FakeApi.md#TestUniqueItemsHeaderAndQueryParameterCollectionFormat) | **Put** /fake/test-unique-parameters |
|
[**TestUniqueItemsHeaderAndQueryParameterCollectionFormat**](FakeApi.md#TestUniqueItemsHeaderAndQueryParameterCollectionFormat) | **Put** /fake/test-unique-parameters |
|
||||||
|
|
||||||
@ -775,7 +776,7 @@ Name | Type | Description | Notes
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: Not defined
|
- **Content-Type**: Not defined
|
||||||
- **Accept**: applicatino/json
|
- **Accept**: application/json
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||||
[[Back to Model list]](../README.md#documentation-for-models)
|
[[Back to Model list]](../README.md#documentation-for-models)
|
||||||
@ -912,6 +913,70 @@ No authorization required
|
|||||||
[[Back to README]](../README.md)
|
[[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
|
## TestQueryDeepObject
|
||||||
|
|
||||||
|
> TestQueryDeepObject(ctx).TestPet(testPet).InputOptions(inputOptions).Execute()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
```go
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
openapiclient "./openapi"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
testPet := map[string][]openapiclient.Pet{"key": map[string]interface{}{ ... }} // Pet | (optional)
|
||||||
|
inputOptions := map[string][]openapiclient.Category{"key": map[string]interface{}{ ... }} // Category | (optional)
|
||||||
|
|
||||||
|
configuration := openapiclient.NewConfiguration()
|
||||||
|
apiClient := openapiclient.NewAPIClient(configuration)
|
||||||
|
resp, r, err := apiClient.FakeApi.TestQueryDeepObject(context.Background()).TestPet(testPet).InputOptions(inputOptions).Execute()
|
||||||
|
if err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "Error when calling `FakeApi.TestQueryDeepObject``: %v\n", err)
|
||||||
|
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Path Parameters
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Other Parameters
|
||||||
|
|
||||||
|
Other parameters are passed through a pointer to a apiTestQueryDeepObjectRequest struct via the builder pattern
|
||||||
|
|
||||||
|
|
||||||
|
Name | Type | Description | Notes
|
||||||
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**testPet** | [**Pet**](Pet.md) | |
|
||||||
|
**inputOptions** | [**Category**](Category.md) | |
|
||||||
|
|
||||||
|
### Return type
|
||||||
|
|
||||||
|
(empty response body)
|
||||||
|
|
||||||
|
### Authorization
|
||||||
|
|
||||||
|
No authorization required
|
||||||
|
|
||||||
|
### HTTP request headers
|
||||||
|
|
||||||
|
- **Content-Type**: Not defined
|
||||||
|
- **Accept**: Not defined
|
||||||
|
|
||||||
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
|
||||||
|
[[Back to Model list]](../README.md#documentation-for-models)
|
||||||
|
[[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|
||||||
## TestQueryParameterCollectionFormat
|
## TestQueryParameterCollectionFormat
|
||||||
|
|
||||||
> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()
|
> TestQueryParameterCollectionFormat(ctx).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute()
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Model200Response type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Model200Response{}
|
||||||
|
|
||||||
// Model200Response Model for testing model name starting with number
|
// Model200Response Model for testing model name starting with number
|
||||||
type Model200Response struct {
|
type Model200Response struct {
|
||||||
Name *int32 `json:"name,omitempty"`
|
Name *int32 `json:"name,omitempty"`
|
||||||
@ -105,6 +108,14 @@ func (o *Model200Response) SetClass(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Model200Response) MarshalJSON() ([]byte, error) {
|
func (o Model200Response) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Model200Response) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Name) {
|
if !isNil(o.Name) {
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
@ -117,7 +128,7 @@ func (o Model200Response) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Model200Response) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Model200Response) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the FooGetDefaultResponse type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &FooGetDefaultResponse{}
|
||||||
|
|
||||||
// FooGetDefaultResponse struct for FooGetDefaultResponse
|
// FooGetDefaultResponse struct for FooGetDefaultResponse
|
||||||
type FooGetDefaultResponse struct {
|
type FooGetDefaultResponse struct {
|
||||||
String *Foo `json:"string,omitempty"`
|
String *Foo `json:"string,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *FooGetDefaultResponse) SetString(v Foo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o FooGetDefaultResponse) MarshalJSON() ([]byte, error) {
|
func (o FooGetDefaultResponse) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o FooGetDefaultResponse) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.String) {
|
if !isNil(o.String) {
|
||||||
toSerialize["string"] = o.String
|
toSerialize["string"] = o.String
|
||||||
@ -81,7 +92,7 @@ func (o FooGetDefaultResponse) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *FooGetDefaultResponse) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *FooGetDefaultResponse) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the SpecialModelName type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &SpecialModelName{}
|
||||||
|
|
||||||
// SpecialModelName struct for SpecialModelName
|
// SpecialModelName struct for SpecialModelName
|
||||||
type SpecialModelName struct {
|
type SpecialModelName struct {
|
||||||
SpecialPropertyName *int64 `json:"$special[property.name],omitempty"`
|
SpecialPropertyName *int64 `json:"$special[property.name],omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *SpecialModelName) SetSpecialPropertyName(v int64) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o SpecialModelName) MarshalJSON() ([]byte, error) {
|
func (o SpecialModelName) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o SpecialModelName) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.SpecialPropertyName) {
|
if !isNil(o.SpecialPropertyName) {
|
||||||
toSerialize["$special[property.name]"] = o.SpecialPropertyName
|
toSerialize["$special[property.name]"] = o.SpecialPropertyName
|
||||||
@ -81,7 +92,7 @@ func (o SpecialModelName) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *SpecialModelName) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *SpecialModelName) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AdditionalPropertiesClass type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AdditionalPropertiesClass{}
|
||||||
|
|
||||||
// AdditionalPropertiesClass struct for AdditionalPropertiesClass
|
// AdditionalPropertiesClass struct for AdditionalPropertiesClass
|
||||||
type AdditionalPropertiesClass struct {
|
type AdditionalPropertiesClass struct {
|
||||||
MapProperty *map[string]string `json:"map_property,omitempty"`
|
MapProperty *map[string]string `json:"map_property,omitempty"`
|
||||||
@ -105,6 +108,14 @@ func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AdditionalPropertiesClass) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.MapProperty) {
|
if !isNil(o.MapProperty) {
|
||||||
toSerialize["map_property"] = o.MapProperty
|
toSerialize["map_property"] = o.MapProperty
|
||||||
@ -117,7 +128,7 @@ func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *AdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *AdditionalPropertiesClass) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Animal type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Animal{}
|
||||||
|
|
||||||
// Animal struct for Animal
|
// Animal struct for Animal
|
||||||
type Animal struct {
|
type Animal struct {
|
||||||
ClassName string `json:"className"`
|
ClassName string `json:"className"`
|
||||||
@ -102,10 +105,16 @@ func (o *Animal) SetColor(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Animal) MarshalJSON() ([]byte, error) {
|
func (o Animal) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["className"] = o.ClassName
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Animal) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["className"] = o.ClassName
|
||||||
if !isNil(o.Color) {
|
if !isNil(o.Color) {
|
||||||
toSerialize["color"] = o.Color
|
toSerialize["color"] = o.Color
|
||||||
}
|
}
|
||||||
@ -114,7 +123,7 @@ func (o Animal) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Animal) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Animal) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ApiResponse type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ApiResponse{}
|
||||||
|
|
||||||
// ApiResponse struct for ApiResponse
|
// ApiResponse struct for ApiResponse
|
||||||
type ApiResponse struct {
|
type ApiResponse struct {
|
||||||
Code *int32 `json:"code,omitempty"`
|
Code *int32 `json:"code,omitempty"`
|
||||||
@ -138,6 +141,14 @@ func (o *ApiResponse) SetMessage(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ApiResponse) MarshalJSON() ([]byte, error) {
|
func (o ApiResponse) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ApiResponse) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Code) {
|
if !isNil(o.Code) {
|
||||||
toSerialize["code"] = o.Code
|
toSerialize["code"] = o.Code
|
||||||
@ -153,7 +164,7 @@ func (o ApiResponse) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ApiResponse) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *ApiResponse) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Apple type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Apple{}
|
||||||
|
|
||||||
// Apple struct for Apple
|
// Apple struct for Apple
|
||||||
type Apple struct {
|
type Apple struct {
|
||||||
Cultivar *string `json:"cultivar,omitempty"`
|
Cultivar *string `json:"cultivar,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *Apple) SetCultivar(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Apple) MarshalJSON() ([]byte, error) {
|
func (o Apple) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Apple) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Cultivar) {
|
if !isNil(o.Cultivar) {
|
||||||
toSerialize["cultivar"] = o.Cultivar
|
toSerialize["cultivar"] = o.Cultivar
|
||||||
@ -81,7 +92,7 @@ func (o Apple) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Apple) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Apple) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the AppleReq type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &AppleReq{}
|
||||||
|
|
||||||
// AppleReq struct for AppleReq
|
// AppleReq struct for AppleReq
|
||||||
type AppleReq struct {
|
type AppleReq struct {
|
||||||
Cultivar string `json:"cultivar"`
|
Cultivar string `json:"cultivar"`
|
||||||
@ -98,10 +101,16 @@ func (o *AppleReq) SetMealy(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o AppleReq) MarshalJSON() ([]byte, error) {
|
func (o AppleReq) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["cultivar"] = o.Cultivar
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o AppleReq) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["cultivar"] = o.Cultivar
|
||||||
if !isNil(o.Mealy) {
|
if !isNil(o.Mealy) {
|
||||||
toSerialize["mealy"] = o.Mealy
|
toSerialize["mealy"] = o.Mealy
|
||||||
}
|
}
|
||||||
@ -110,7 +119,7 @@ func (o AppleReq) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *AppleReq) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *AppleReq) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ArrayOfArrayOfNumberOnly type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ArrayOfArrayOfNumberOnly{}
|
||||||
|
|
||||||
// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly
|
// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly
|
||||||
type ArrayOfArrayOfNumberOnly struct {
|
type ArrayOfArrayOfNumberOnly struct {
|
||||||
ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
|
ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ArrayOfArrayOfNumberOnly) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.ArrayArrayNumber) {
|
if !isNil(o.ArrayArrayNumber) {
|
||||||
toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber
|
toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber
|
||||||
@ -81,7 +92,7 @@ func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ArrayOfArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *ArrayOfArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ArrayOfNumberOnly type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ArrayOfNumberOnly{}
|
||||||
|
|
||||||
// ArrayOfNumberOnly struct for ArrayOfNumberOnly
|
// ArrayOfNumberOnly struct for ArrayOfNumberOnly
|
||||||
type ArrayOfNumberOnly struct {
|
type ArrayOfNumberOnly struct {
|
||||||
ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
|
ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ArrayOfNumberOnly) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.ArrayNumber) {
|
if !isNil(o.ArrayNumber) {
|
||||||
toSerialize["ArrayNumber"] = o.ArrayNumber
|
toSerialize["ArrayNumber"] = o.ArrayNumber
|
||||||
@ -81,7 +92,7 @@ func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *ArrayOfNumberOnly) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ArrayTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ArrayTest{}
|
||||||
|
|
||||||
// ArrayTest struct for ArrayTest
|
// ArrayTest struct for ArrayTest
|
||||||
type ArrayTest struct {
|
type ArrayTest struct {
|
||||||
ArrayOfString []string `json:"array_of_string,omitempty"`
|
ArrayOfString []string `json:"array_of_string,omitempty"`
|
||||||
@ -138,6 +141,14 @@ func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ArrayTest) MarshalJSON() ([]byte, error) {
|
func (o ArrayTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ArrayTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.ArrayOfString) {
|
if !isNil(o.ArrayOfString) {
|
||||||
toSerialize["array_of_string"] = o.ArrayOfString
|
toSerialize["array_of_string"] = o.ArrayOfString
|
||||||
@ -153,7 +164,7 @@ func (o ArrayTest) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ArrayTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *ArrayTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Banana type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Banana{}
|
||||||
|
|
||||||
// Banana struct for Banana
|
// Banana struct for Banana
|
||||||
type Banana struct {
|
type Banana struct {
|
||||||
LengthCm *float32 `json:"lengthCm,omitempty"`
|
LengthCm *float32 `json:"lengthCm,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *Banana) SetLengthCm(v float32) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Banana) MarshalJSON() ([]byte, error) {
|
func (o Banana) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Banana) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.LengthCm) {
|
if !isNil(o.LengthCm) {
|
||||||
toSerialize["lengthCm"] = o.LengthCm
|
toSerialize["lengthCm"] = o.LengthCm
|
||||||
@ -81,7 +92,7 @@ func (o Banana) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Banana) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Banana) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the BananaReq type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &BananaReq{}
|
||||||
|
|
||||||
// BananaReq struct for BananaReq
|
// BananaReq struct for BananaReq
|
||||||
type BananaReq struct {
|
type BananaReq struct {
|
||||||
LengthCm float32 `json:"lengthCm"`
|
LengthCm float32 `json:"lengthCm"`
|
||||||
@ -98,10 +101,16 @@ func (o *BananaReq) SetSweet(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o BananaReq) MarshalJSON() ([]byte, error) {
|
func (o BananaReq) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["lengthCm"] = o.LengthCm
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o BananaReq) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["lengthCm"] = o.LengthCm
|
||||||
if !isNil(o.Sweet) {
|
if !isNil(o.Sweet) {
|
||||||
toSerialize["sweet"] = o.Sweet
|
toSerialize["sweet"] = o.Sweet
|
||||||
}
|
}
|
||||||
@ -110,7 +119,7 @@ func (o BananaReq) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *BananaReq) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *BananaReq) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Capitalization type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Capitalization{}
|
||||||
|
|
||||||
// Capitalization struct for Capitalization
|
// Capitalization struct for Capitalization
|
||||||
type Capitalization struct {
|
type Capitalization struct {
|
||||||
SmallCamel *string `json:"smallCamel,omitempty"`
|
SmallCamel *string `json:"smallCamel,omitempty"`
|
||||||
@ -238,6 +241,14 @@ func (o *Capitalization) SetATT_NAME(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Capitalization) MarshalJSON() ([]byte, error) {
|
func (o Capitalization) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Capitalization) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.SmallCamel) {
|
if !isNil(o.SmallCamel) {
|
||||||
toSerialize["smallCamel"] = o.SmallCamel
|
toSerialize["smallCamel"] = o.SmallCamel
|
||||||
@ -262,7 +273,7 @@ func (o Capitalization) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Capitalization) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Capitalization) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -16,6 +16,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Cat type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Cat{}
|
||||||
|
|
||||||
// Cat struct for Cat
|
// Cat struct for Cat
|
||||||
type Cat struct {
|
type Cat struct {
|
||||||
Animal
|
Animal
|
||||||
@ -78,14 +81,22 @@ func (o *Cat) SetDeclawed(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Cat) MarshalJSON() ([]byte, error) {
|
func (o Cat) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Cat) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
if !isNil(o.Declawed) {
|
if !isNil(o.Declawed) {
|
||||||
toSerialize["declawed"] = o.Declawed
|
toSerialize["declawed"] = o.Declawed
|
||||||
@ -95,7 +106,7 @@ func (o Cat) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Cat) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Cat) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the CatAllOf type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &CatAllOf{}
|
||||||
|
|
||||||
// CatAllOf struct for CatAllOf
|
// CatAllOf struct for CatAllOf
|
||||||
type CatAllOf struct {
|
type CatAllOf struct {
|
||||||
Declawed *bool `json:"declawed,omitempty"`
|
Declawed *bool `json:"declawed,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *CatAllOf) SetDeclawed(v bool) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o CatAllOf) MarshalJSON() ([]byte, error) {
|
func (o CatAllOf) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o CatAllOf) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Declawed) {
|
if !isNil(o.Declawed) {
|
||||||
toSerialize["declawed"] = o.Declawed
|
toSerialize["declawed"] = o.Declawed
|
||||||
@ -81,7 +92,7 @@ func (o CatAllOf) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *CatAllOf) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *CatAllOf) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Category type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Category{}
|
||||||
|
|
||||||
// Category struct for Category
|
// Category struct for Category
|
||||||
type Category struct {
|
type Category struct {
|
||||||
Id *int64 `json:"id,omitempty"`
|
Id *int64 `json:"id,omitempty"`
|
||||||
@ -100,19 +103,25 @@ func (o *Category) SetName(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Category) MarshalJSON() ([]byte, error) {
|
func (o Category) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Category) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Id) {
|
if !isNil(o.Id) {
|
||||||
toSerialize["id"] = o.Id
|
toSerialize["id"] = o.Id
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["name"] = o.Name
|
toSerialize["name"] = o.Name
|
||||||
}
|
|
||||||
|
|
||||||
for key, value := range o.AdditionalProperties {
|
for key, value := range o.AdditionalProperties {
|
||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Category) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Category) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the ClassModel type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &ClassModel{}
|
||||||
|
|
||||||
// ClassModel Model for testing model with \"_class\" property
|
// ClassModel Model for testing model with \"_class\" property
|
||||||
type ClassModel struct {
|
type ClassModel struct {
|
||||||
Class *string `json:"_class,omitempty"`
|
Class *string `json:"_class,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *ClassModel) SetClass(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o ClassModel) MarshalJSON() ([]byte, error) {
|
func (o ClassModel) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o ClassModel) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Class) {
|
if !isNil(o.Class) {
|
||||||
toSerialize["_class"] = o.Class
|
toSerialize["_class"] = o.Class
|
||||||
@ -81,7 +92,7 @@ func (o ClassModel) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *ClassModel) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *ClassModel) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Client type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Client{}
|
||||||
|
|
||||||
// Client struct for Client
|
// Client struct for Client
|
||||||
type Client struct {
|
type Client struct {
|
||||||
Client *string `json:"client,omitempty"`
|
Client *string `json:"client,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *Client) SetClient(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Client) MarshalJSON() ([]byte, error) {
|
func (o Client) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Client) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Client) {
|
if !isNil(o.Client) {
|
||||||
toSerialize["client"] = o.Client
|
toSerialize["client"] = o.Client
|
||||||
@ -81,7 +92,7 @@ func (o Client) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Client) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Client) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -16,6 +16,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Dog type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Dog{}
|
||||||
|
|
||||||
// Dog struct for Dog
|
// Dog struct for Dog
|
||||||
type Dog struct {
|
type Dog struct {
|
||||||
Animal
|
Animal
|
||||||
@ -78,14 +81,22 @@ func (o *Dog) SetBreed(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Dog) MarshalJSON() ([]byte, error) {
|
func (o Dog) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Dog) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
serializedAnimal, errAnimal := json.Marshal(o.Animal)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
errAnimal = json.Unmarshal([]byte(serializedAnimal), &toSerialize)
|
||||||
if errAnimal != nil {
|
if errAnimal != nil {
|
||||||
return []byte{}, errAnimal
|
return map[string]interface{}{}, errAnimal
|
||||||
}
|
}
|
||||||
if !isNil(o.Breed) {
|
if !isNil(o.Breed) {
|
||||||
toSerialize["breed"] = o.Breed
|
toSerialize["breed"] = o.Breed
|
||||||
@ -95,7 +106,7 @@ func (o Dog) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Dog) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Dog) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the DogAllOf type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &DogAllOf{}
|
||||||
|
|
||||||
// DogAllOf struct for DogAllOf
|
// DogAllOf struct for DogAllOf
|
||||||
type DogAllOf struct {
|
type DogAllOf struct {
|
||||||
Breed *string `json:"breed,omitempty"`
|
Breed *string `json:"breed,omitempty"`
|
||||||
@ -72,6 +75,14 @@ func (o *DogAllOf) SetBreed(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o DogAllOf) MarshalJSON() ([]byte, error) {
|
func (o DogAllOf) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o DogAllOf) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Breed) {
|
if !isNil(o.Breed) {
|
||||||
toSerialize["breed"] = o.Breed
|
toSerialize["breed"] = o.Breed
|
||||||
@ -81,7 +92,7 @@ func (o DogAllOf) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *DogAllOf) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *DogAllOf) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -16,6 +16,9 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the DuplicatedPropChild type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &DuplicatedPropChild{}
|
||||||
|
|
||||||
// DuplicatedPropChild struct for DuplicatedPropChild
|
// DuplicatedPropChild struct for DuplicatedPropChild
|
||||||
type DuplicatedPropChild struct {
|
type DuplicatedPropChild struct {
|
||||||
DuplicatedPropParent
|
DuplicatedPropParent
|
||||||
@ -76,14 +79,22 @@ func (o *DuplicatedPropChild) SetDupProp(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o DuplicatedPropChild) MarshalJSON() ([]byte, error) {
|
func (o DuplicatedPropChild) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o DuplicatedPropChild) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
serializedDuplicatedPropParent, errDuplicatedPropParent := json.Marshal(o.DuplicatedPropParent)
|
serializedDuplicatedPropParent, errDuplicatedPropParent := json.Marshal(o.DuplicatedPropParent)
|
||||||
if errDuplicatedPropParent != nil {
|
if errDuplicatedPropParent != nil {
|
||||||
return []byte{}, errDuplicatedPropParent
|
return map[string]interface{}{}, errDuplicatedPropParent
|
||||||
}
|
}
|
||||||
errDuplicatedPropParent = json.Unmarshal([]byte(serializedDuplicatedPropParent), &toSerialize)
|
errDuplicatedPropParent = json.Unmarshal([]byte(serializedDuplicatedPropParent), &toSerialize)
|
||||||
if errDuplicatedPropParent != nil {
|
if errDuplicatedPropParent != nil {
|
||||||
return []byte{}, errDuplicatedPropParent
|
return map[string]interface{}{}, errDuplicatedPropParent
|
||||||
}
|
}
|
||||||
if !isNil(o.DupProp) {
|
if !isNil(o.DupProp) {
|
||||||
toSerialize["dup-prop"] = o.DupProp
|
toSerialize["dup-prop"] = o.DupProp
|
||||||
@ -93,7 +104,7 @@ func (o DuplicatedPropChild) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *DuplicatedPropChild) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *DuplicatedPropChild) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the DuplicatedPropChildAllOf type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &DuplicatedPropChildAllOf{}
|
||||||
|
|
||||||
// DuplicatedPropChildAllOf struct for DuplicatedPropChildAllOf
|
// DuplicatedPropChildAllOf struct for DuplicatedPropChildAllOf
|
||||||
type DuplicatedPropChildAllOf struct {
|
type DuplicatedPropChildAllOf struct {
|
||||||
// A discriminator value
|
// A discriminator value
|
||||||
@ -73,6 +76,14 @@ func (o *DuplicatedPropChildAllOf) SetDupProp(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o DuplicatedPropChildAllOf) MarshalJSON() ([]byte, error) {
|
func (o DuplicatedPropChildAllOf) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o DuplicatedPropChildAllOf) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.DupProp) {
|
if !isNil(o.DupProp) {
|
||||||
toSerialize["dup-prop"] = o.DupProp
|
toSerialize["dup-prop"] = o.DupProp
|
||||||
@ -82,7 +93,7 @@ func (o DuplicatedPropChildAllOf) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *DuplicatedPropChildAllOf) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *DuplicatedPropChildAllOf) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the DuplicatedPropParent type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &DuplicatedPropParent{}
|
||||||
|
|
||||||
// DuplicatedPropParent parent model with duplicated property
|
// DuplicatedPropParent parent model with duplicated property
|
||||||
type DuplicatedPropParent struct {
|
type DuplicatedPropParent struct {
|
||||||
// A discriminator value
|
// A discriminator value
|
||||||
@ -66,16 +69,22 @@ func (o *DuplicatedPropParent) SetDupProp(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o DuplicatedPropParent) MarshalJSON() ([]byte, error) {
|
func (o DuplicatedPropParent) MarshalJSON() ([]byte, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize,err := o.ToMap()
|
||||||
if true {
|
if err != nil {
|
||||||
toSerialize["dup-prop"] = o.DupProp
|
return []byte{}, err
|
||||||
}
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o DuplicatedPropParent) ToMap() (map[string]interface{}, error) {
|
||||||
|
toSerialize := map[string]interface{}{}
|
||||||
|
toSerialize["dup-prop"] = o.DupProp
|
||||||
|
|
||||||
for key, value := range o.AdditionalProperties {
|
for key, value := range o.AdditionalProperties {
|
||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *DuplicatedPropParent) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *DuplicatedPropParent) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the EnumArrays type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &EnumArrays{}
|
||||||
|
|
||||||
// EnumArrays struct for EnumArrays
|
// EnumArrays struct for EnumArrays
|
||||||
type EnumArrays struct {
|
type EnumArrays struct {
|
||||||
JustSymbol *string `json:"just_symbol,omitempty"`
|
JustSymbol *string `json:"just_symbol,omitempty"`
|
||||||
@ -105,6 +108,14 @@ func (o *EnumArrays) SetArrayEnum(v []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o EnumArrays) MarshalJSON() ([]byte, error) {
|
func (o EnumArrays) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o EnumArrays) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.JustSymbol) {
|
if !isNil(o.JustSymbol) {
|
||||||
toSerialize["just_symbol"] = o.JustSymbol
|
toSerialize["just_symbol"] = o.JustSymbol
|
||||||
@ -117,7 +128,7 @@ func (o EnumArrays) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *EnumArrays) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *EnumArrays) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the EnumTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &EnumTest{}
|
||||||
|
|
||||||
// EnumTest struct for EnumTest
|
// EnumTest struct for EnumTest
|
||||||
type EnumTest struct {
|
type EnumTest struct {
|
||||||
EnumString *string `json:"enum_string,omitempty"`
|
EnumString *string `json:"enum_string,omitempty"`
|
||||||
@ -314,13 +317,19 @@ func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValu
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o EnumTest) MarshalJSON() ([]byte, error) {
|
func (o EnumTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o EnumTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.EnumString) {
|
if !isNil(o.EnumString) {
|
||||||
toSerialize["enum_string"] = o.EnumString
|
toSerialize["enum_string"] = o.EnumString
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["enum_string_required"] = o.EnumStringRequired
|
toSerialize["enum_string_required"] = o.EnumStringRequired
|
||||||
}
|
|
||||||
if !isNil(o.EnumInteger) {
|
if !isNil(o.EnumInteger) {
|
||||||
toSerialize["enum_integer"] = o.EnumInteger
|
toSerialize["enum_integer"] = o.EnumInteger
|
||||||
}
|
}
|
||||||
@ -344,7 +353,7 @@ func (o EnumTest) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the File type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &File{}
|
||||||
|
|
||||||
// File Must be named `File` for test.
|
// File Must be named `File` for test.
|
||||||
type File struct {
|
type File struct {
|
||||||
// Test capitalization
|
// Test capitalization
|
||||||
@ -73,6 +76,14 @@ func (o *File) SetSourceURI(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o File) MarshalJSON() ([]byte, error) {
|
func (o File) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o File) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.SourceURI) {
|
if !isNil(o.SourceURI) {
|
||||||
toSerialize["sourceURI"] = o.SourceURI
|
toSerialize["sourceURI"] = o.SourceURI
|
||||||
@ -82,7 +93,7 @@ func (o File) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *File) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *File) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the FileSchemaTestClass type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &FileSchemaTestClass{}
|
||||||
|
|
||||||
// FileSchemaTestClass struct for FileSchemaTestClass
|
// FileSchemaTestClass struct for FileSchemaTestClass
|
||||||
type FileSchemaTestClass struct {
|
type FileSchemaTestClass struct {
|
||||||
File *File `json:"file,omitempty"`
|
File *File `json:"file,omitempty"`
|
||||||
@ -105,6 +108,14 @@ func (o *FileSchemaTestClass) SetFiles(v []File) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) {
|
func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o FileSchemaTestClass) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.File) {
|
if !isNil(o.File) {
|
||||||
toSerialize["file"] = o.File
|
toSerialize["file"] = o.File
|
||||||
@ -117,7 +128,7 @@ func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *FileSchemaTestClass) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *FileSchemaTestClass) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -14,6 +14,9 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the Foo type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &Foo{}
|
||||||
|
|
||||||
// Foo struct for Foo
|
// Foo struct for Foo
|
||||||
type Foo struct {
|
type Foo struct {
|
||||||
Bar *string `json:"bar,omitempty"`
|
Bar *string `json:"bar,omitempty"`
|
||||||
@ -76,6 +79,14 @@ func (o *Foo) SetBar(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o Foo) MarshalJSON() ([]byte, error) {
|
func (o Foo) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o Foo) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Bar) {
|
if !isNil(o.Bar) {
|
||||||
toSerialize["bar"] = o.Bar
|
toSerialize["bar"] = o.Bar
|
||||||
@ -85,7 +96,7 @@ func (o Foo) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Foo) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *Foo) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
@ -16,6 +16,9 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// checks if the FormatTest type satisfies the MappedNullable interface at compile time
|
||||||
|
var _ MappedNullable = &FormatTest{}
|
||||||
|
|
||||||
// FormatTest struct for FormatTest
|
// FormatTest struct for FormatTest
|
||||||
type FormatTest struct {
|
type FormatTest struct {
|
||||||
Integer *int32 `json:"integer,omitempty"`
|
Integer *int32 `json:"integer,omitempty"`
|
||||||
@ -510,6 +513,14 @@ func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o FormatTest) MarshalJSON() ([]byte, error) {
|
func (o FormatTest) MarshalJSON() ([]byte, error) {
|
||||||
|
toSerialize,err := o.ToMap()
|
||||||
|
if err != nil {
|
||||||
|
return []byte{}, err
|
||||||
|
}
|
||||||
|
return json.Marshal(toSerialize)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (o FormatTest) ToMap() (map[string]interface{}, error) {
|
||||||
toSerialize := map[string]interface{}{}
|
toSerialize := map[string]interface{}{}
|
||||||
if !isNil(o.Integer) {
|
if !isNil(o.Integer) {
|
||||||
toSerialize["integer"] = o.Integer
|
toSerialize["integer"] = o.Integer
|
||||||
@ -520,9 +531,7 @@ func (o FormatTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.Int64) {
|
if !isNil(o.Int64) {
|
||||||
toSerialize["int64"] = o.Int64
|
toSerialize["int64"] = o.Int64
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["number"] = o.Number
|
toSerialize["number"] = o.Number
|
||||||
}
|
|
||||||
if !isNil(o.Float) {
|
if !isNil(o.Float) {
|
||||||
toSerialize["float"] = o.Float
|
toSerialize["float"] = o.Float
|
||||||
}
|
}
|
||||||
@ -532,24 +541,18 @@ func (o FormatTest) MarshalJSON() ([]byte, error) {
|
|||||||
if !isNil(o.String) {
|
if !isNil(o.String) {
|
||||||
toSerialize["string"] = o.String
|
toSerialize["string"] = o.String
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["byte"] = o.Byte
|
toSerialize["byte"] = o.Byte
|
||||||
}
|
|
||||||
if !isNil(o.Binary) {
|
if !isNil(o.Binary) {
|
||||||
toSerialize["binary"] = o.Binary
|
toSerialize["binary"] = o.Binary
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["date"] = o.Date
|
toSerialize["date"] = o.Date
|
||||||
}
|
|
||||||
if !isNil(o.DateTime) {
|
if !isNil(o.DateTime) {
|
||||||
toSerialize["dateTime"] = o.DateTime
|
toSerialize["dateTime"] = o.DateTime
|
||||||
}
|
}
|
||||||
if !isNil(o.Uuid) {
|
if !isNil(o.Uuid) {
|
||||||
toSerialize["uuid"] = o.Uuid
|
toSerialize["uuid"] = o.Uuid
|
||||||
}
|
}
|
||||||
if true {
|
|
||||||
toSerialize["password"] = o.Password
|
toSerialize["password"] = o.Password
|
||||||
}
|
|
||||||
if !isNil(o.PatternWithDigits) {
|
if !isNil(o.PatternWithDigits) {
|
||||||
toSerialize["pattern_with_digits"] = o.PatternWithDigits
|
toSerialize["pattern_with_digits"] = o.PatternWithDigits
|
||||||
}
|
}
|
||||||
@ -561,7 +564,7 @@ func (o FormatTest) MarshalJSON() ([]byte, error) {
|
|||||||
toSerialize[key] = value
|
toSerialize[key] = value
|
||||||
}
|
}
|
||||||
|
|
||||||
return json.Marshal(toSerialize)
|
return toSerialize, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) {
|
func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) {
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user