forked from loafle/openapi-generator-original
various fix for go petstore
This commit is contained in:
@@ -193,32 +193,6 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
return "api_" + underscore(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides postProcessParameter to add a vendor extension "x-exportParamName".
|
||||
* This is useful when paramName starts with a lowercase letter, but we need that
|
||||
* param to be exportable (starts with an Uppercase letter).
|
||||
*
|
||||
* @param parameter CodegenParameter object to be processed.
|
||||
|
||||
@Override
|
||||
|
||||
public void postProcessParameter(CodegenParameter parameter) {
|
||||
|
||||
// Give the base class a chance to process
|
||||
super.postProcessParameter(parameter);
|
||||
|
||||
char nameFirstChar = parameter.paramName.charAt(0);
|
||||
if (Character.isUpperCase(nameFirstChar)) {
|
||||
// First char is already uppercase, just use paramName.
|
||||
parameter.vendorExtensions.put("x-exportParamName", parameter.paramName);
|
||||
} else {
|
||||
// It's a lowercase first char, let's convert it to uppercase
|
||||
StringBuilder sb = new StringBuilder(parameter.paramName);
|
||||
sb.setCharAt(0, Character.toUpperCase(nameFirstChar));
|
||||
parameter.vendorExtensions.put("x-exportParamName", sb.toString());
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public String getTypeDeclaration(Schema p) {
|
||||
if (ModelUtils.isArraySchema(p)) {
|
||||
@@ -335,13 +309,14 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
// We need to specially map Time type to the optionals package
|
||||
if ("time.Time".equals(param.dataType)) {
|
||||
param.vendorExtensions.put("x-optionalDataType", "Time");
|
||||
continue;
|
||||
} else {
|
||||
// Map optional type to dataType
|
||||
param.vendorExtensions.put("x-optionalDataType",
|
||||
param.dataType.substring(0, 1).toUpperCase() + param.dataType.substring(1));
|
||||
}
|
||||
// Map optional type to dataType
|
||||
param.vendorExtensions.put("x-optionalDataType",
|
||||
param.dataType.substring(0, 1).toUpperCase() + param.dataType.substring(1));
|
||||
}
|
||||
|
||||
// set x-exportParamName
|
||||
char nameFirstChar = param.paramName.charAt(0);
|
||||
if (Character.isUpperCase(nameFirstChar)) {
|
||||
// First char is already uppercase, just use paramName.
|
||||
@@ -353,6 +328,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
param.vendorExtensions.put("x-exportParamName", sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
setExportParameterName(operation.queryParams);
|
||||
setExportParameterName(operation.formParams);
|
||||
setExportParameterName(operation.headerParams);
|
||||
setExportParameterName(operation.bodyParams);
|
||||
setExportParameterName(operation.cookieParams);
|
||||
setExportParameterName(operation.optionalParams);
|
||||
setExportParameterName(operation.requiredParams);
|
||||
|
||||
}
|
||||
|
||||
// recursively add import for mapping one type to multiple imports
|
||||
@@ -373,6 +357,21 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
return objs;
|
||||
}
|
||||
|
||||
private void setExportParameterName(List<CodegenParameter> codegenParameters) {
|
||||
for (CodegenParameter param : codegenParameters) {
|
||||
char nameFirstChar = param.paramName.charAt(0);
|
||||
if (Character.isUpperCase(nameFirstChar)) {
|
||||
// First char is already uppercase, just use paramName.
|
||||
param.vendorExtensions.put("x-exportParamName", param.paramName);
|
||||
} else {
|
||||
// It's a lowercase first char, let's convert it to uppercase
|
||||
StringBuilder sb = new StringBuilder(param.paramName);
|
||||
sb.setCharAt(0, Character.toUpperCase(nameFirstChar));
|
||||
param.vendorExtensions.put("x-exportParamName", sb.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> postProcessModels(Map<String, Object> objs) {
|
||||
// remove model imports to avoid error
|
||||
@@ -393,11 +392,11 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
if (v instanceof CodegenModel) {
|
||||
CodegenModel model = (CodegenModel) v;
|
||||
for (CodegenProperty param : model.vars) {
|
||||
if (!addedTimeImport && param.baseType == "time.Time") {
|
||||
if (!addedTimeImport && "time.Time".equals(param.baseType)) {
|
||||
imports.add(createMapping("import", "time"));
|
||||
addedTimeImport = true;
|
||||
}
|
||||
if (!addedOSImport && param.baseType == "*os.File") {
|
||||
if (!addedOSImport && "*os.File".equals(param.baseType)) {
|
||||
imports.add(createMapping("import", "os"));
|
||||
addedOSImport = true;
|
||||
}
|
||||
|
||||
@@ -21,19 +21,46 @@ type {{classname}}Service service
|
||||
{{#operation}}
|
||||
|
||||
/*
|
||||
{{{classname}}}Service{{#summary}} {{.}}{{/summary}}{{#notes}}
|
||||
{{notes}}{{/notes}}
|
||||
{{{classname}}}Service{{#summary}} {{.}}{{/summary}}
|
||||
{{#notes}}
|
||||
{{notes}}
|
||||
{{/notes}}
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
{{#allParams}}{{#required}} * @param {{paramName}}{{#description}} {{.}}{{/description}}
|
||||
{{/required}}{{/allParams}}{{#hasOptionalParams}} * @param optional nil or *{{{nickname}}}Opts - Optional Parameters:
|
||||
{{#allParams}}{{^required}} * @param "{{vendorExtensions.x-exportParamName}}" ({{#isPrimitiveType}}optional.{{vendorExtensions.x-optionalDataType}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{.}}{{/description}}
|
||||
{{/required}}{{/allParams}}{{/hasOptionalParams}}
|
||||
{{#returnType}}@return {{{returnType}}}{{/returnType}}
|
||||
{{#allParams}}
|
||||
{{#required}}
|
||||
* @param {{paramName}}{{#description}} {{.}}{{/description}}
|
||||
{{/required}}
|
||||
{{/allParams}}
|
||||
{{#hasOptionalParams}}
|
||||
* @param optional nil or *{{{nickname}}}Opts - Optional Parameters:
|
||||
{{#allParams}}
|
||||
{{^required}}
|
||||
* @param "{{vendorExtensions.x-exportParamName}}" ({{#isPrimitiveType}}{{^isBinary}}optional.{{vendorExtensions.x-optionalDataType}}{{/isBinary}}{{#isBinary}}optional.Interface of {{dataType}}{{/isBinary}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{{.}}}{{/description}}
|
||||
{{/required}}
|
||||
{{/allParams}}
|
||||
{{/hasOptionalParams}}
|
||||
{{#returnType}}
|
||||
@return {{{returnType}}}
|
||||
{{/returnType}}
|
||||
*/
|
||||
{{#hasOptionalParams}}
|
||||
|
||||
type {{{nickname}}}Opts struct { {{#allParams}}{{^required}}
|
||||
{{#isPrimitiveType}} {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}}{{/isPrimitiveType}}{{^isPrimitiveType}} {{vendorExtensions.x-exportParamName}} optional.Interface{{/isPrimitiveType}}{{/required}}{{/allParams}}
|
||||
type {{{nickname}}}Opts struct {
|
||||
{{#allParams}}
|
||||
{{^required}}
|
||||
{{#isPrimitiveType}}
|
||||
{{^isBinary}}
|
||||
{{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}}
|
||||
{{/isBinary}}
|
||||
{{#isBinary}}
|
||||
{{vendorExtensions.x-exportParamName}} optional.Interface
|
||||
{{/isBinary}}
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
{{vendorExtensions.x-exportParamName}} optional.Interface
|
||||
{{/isPrimitiveType}}
|
||||
{{/required}}
|
||||
{{/allParams}}
|
||||
}
|
||||
|
||||
{{/hasOptionalParams}}
|
||||
@@ -43,7 +70,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
{{#returnType}}localVarReturnValue {{{returnType}}}{{/returnType}}
|
||||
{{#returnType}}
|
||||
localVarReturnValue {{{returnType}}}
|
||||
{{/returnType}}
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -179,14 +208,14 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
{{/hasFormParams}}
|
||||
{{#hasBodyParam}}
|
||||
{{#bodyParams}}
|
||||
// body params
|
||||
// body params
|
||||
{{#required}}
|
||||
localVarPostBody = &{{paramName}}
|
||||
{{/required}}
|
||||
{{^required}}
|
||||
if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() {
|
||||
{{#isPrimitiveType}}
|
||||
localVarPostBody = &localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value()
|
||||
localVarPostBody = localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value()
|
||||
{{/isPrimitiveType}}
|
||||
{{^isPrimitiveType}}
|
||||
localVarOptional{{vendorExtensions.x-exportParamName}}, localVarOptional{{vendorExtensions.x-exportParamName}}ok := localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value().({{{dataType}}})
|
||||
@@ -196,6 +225,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
localVarPostBody = &localVarOptional{{vendorExtensions.x-exportParamName}}
|
||||
{{/isPrimitiveType}}
|
||||
}
|
||||
|
||||
{{/required}}
|
||||
{{/bodyParams}}
|
||||
{{/hasBodyParam}}
|
||||
@@ -214,6 +244,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
{{#isKeyInQuery}}localVarQueryParams.Add("{{keyParamName}}", key){{/isKeyInQuery}}
|
||||
}
|
||||
}
|
||||
|
||||
{{/isApiKey}}
|
||||
{{/authMethods}}
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
@@ -240,14 +271,15 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err
|
||||
}
|
||||
}
|
||||
{{/returnType}}
|
||||
|
||||
{{/returnType}}
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
{{#responses}}{{#dataType}}
|
||||
{{#responses}}
|
||||
{{#dataType}}
|
||||
if localVarHttpResponse.StatusCode == {{{code}}} {
|
||||
var v {{{dataType}}}
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -258,10 +290,12 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
newErr.model = v
|
||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr
|
||||
}
|
||||
{{/dataType}}{{/responses}}
|
||||
{{/dataType}}
|
||||
{{/responses}}
|
||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil
|
||||
}
|
||||
{{/operation}}{{/operations}}
|
||||
{{/operation}}
|
||||
{{/operations}}
|
||||
@@ -1,10 +1,20 @@
|
||||
{{>partial_header}}
|
||||
package {{packageName}}
|
||||
{{#models}}{{#imports}}
|
||||
import ({{/imports}}{{#imports}}
|
||||
"{{import}}"{{/imports}}{{#imports}}
|
||||
{{#models}}
|
||||
{{#imports}}
|
||||
{{#-first}}
|
||||
import (
|
||||
{{/-first}}
|
||||
"{{import}}"
|
||||
{{#-last}}
|
||||
)
|
||||
{{/imports}}{{#model}}{{#isEnum}}{{#description}}// {{{classname}}} : {{{description}}}{{/description}}
|
||||
{{/-last}}
|
||||
{{/imports}}
|
||||
{{#model}}
|
||||
{{#isEnum}}
|
||||
{{#description}}
|
||||
// {{{classname}}} : {{{description}}}
|
||||
{{/description}}
|
||||
type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/format}}
|
||||
|
||||
// List of {{{name}}}
|
||||
@@ -27,4 +37,7 @@ type {{classname}} struct {
|
||||
{{/description}}
|
||||
{{name}} {{^isEnum}}{{^isPrimitiveType}}{{^isContainer}}{{^isDateTime}}*{{/isDateTime}}{{/isContainer}}{{/isPrimitiveType}}{{/isEnum}}{{{datatype}}} `json:"{{baseName}}{{^required}},omitempty{{/required}}"{{#withXml}} xml:"{{baseName}}"{{/withXml}}`
|
||||
{{/vars}}
|
||||
}{{/isEnum}}{{/model}}{{/models}}
|
||||
}
|
||||
{{/isEnum}}
|
||||
{{/model}}
|
||||
{{/models}}
|
||||
@@ -7,7 +7,7 @@ This API client was generated by the [swagger-codegen](https://github.com/swagge
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build package: io.swagger.codegen.languages.GoClientCodegen
|
||||
- Build package: org.openapitools.codegen.languages.GoClientCodegen
|
||||
|
||||
## Installation
|
||||
Put the package under your project folder and add the following in import:
|
||||
@@ -64,9 +64,11 @@ Class | Method | HTTP request | Description
|
||||
- [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||
- [ArrayTest](docs/ArrayTest.md)
|
||||
- [Capitalization](docs/Capitalization.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [Category](docs/Category.md)
|
||||
- [ClassModel](docs/ClassModel.md)
|
||||
- [Client](docs/Client.md)
|
||||
- [Dog](docs/Dog.md)
|
||||
- [EnumArrays](docs/EnumArrays.md)
|
||||
- [EnumClass](docs/EnumClass.md)
|
||||
- [EnumTest](docs/EnumTest.md)
|
||||
@@ -81,18 +83,13 @@ Class | Method | HTTP request | Description
|
||||
- [Name](docs/Name.md)
|
||||
- [NumberOnly](docs/NumberOnly.md)
|
||||
- [Order](docs/Order.md)
|
||||
- [OuterBoolean](docs/OuterBoolean.md)
|
||||
- [OuterComposite](docs/OuterComposite.md)
|
||||
- [OuterEnum](docs/OuterEnum.md)
|
||||
- [OuterNumber](docs/OuterNumber.md)
|
||||
- [OuterString](docs/OuterString.md)
|
||||
- [Pet](docs/Pet.md)
|
||||
- [ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [SpecialModelName](docs/SpecialModelName.md)
|
||||
- [Tag](docs/Tag.md)
|
||||
- [User](docs/User.md)
|
||||
- [Cat](docs/Cat.md)
|
||||
- [Dog](docs/Dog.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
@@ -100,11 +100,11 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
default: available
|
||||
enum:
|
||||
- available
|
||||
- pending
|
||||
- sold
|
||||
default: available
|
||||
responses:
|
||||
200:
|
||||
description: successful operation
|
||||
@@ -613,20 +613,20 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
default: $
|
||||
enum:
|
||||
- '>'
|
||||
- $
|
||||
default: $
|
||||
- name: enum_header_string
|
||||
in: header
|
||||
description: Header parameter enum test (string)
|
||||
schema:
|
||||
type: string
|
||||
default: -efg
|
||||
enum:
|
||||
- _abc
|
||||
- -efg
|
||||
- (xyz)
|
||||
default: -efg
|
||||
- name: enum_query_string_array
|
||||
in: query
|
||||
description: Query parameter enum test (string array)
|
||||
@@ -635,20 +635,20 @@ paths:
|
||||
type: array
|
||||
items:
|
||||
type: string
|
||||
default: $
|
||||
enum:
|
||||
- '>'
|
||||
- $
|
||||
default: $
|
||||
- name: enum_query_string
|
||||
in: query
|
||||
description: Query parameter enum test (string)
|
||||
schema:
|
||||
type: string
|
||||
default: -efg
|
||||
enum:
|
||||
- _abc
|
||||
- -efg
|
||||
- (xyz)
|
||||
default: -efg
|
||||
- name: enum_query_integer
|
||||
in: query
|
||||
description: Query parameter enum test (double)
|
||||
@@ -677,18 +677,18 @@ paths:
|
||||
description: Form parameter enum test (string array)
|
||||
items:
|
||||
type: string
|
||||
default: $
|
||||
enum:
|
||||
- '>'
|
||||
- $
|
||||
default: $
|
||||
enum_form_string:
|
||||
type: string
|
||||
description: Form parameter enum test (string)
|
||||
default: -efg
|
||||
enum:
|
||||
- _abc
|
||||
- -efg
|
||||
- (xyz)
|
||||
default: -efg
|
||||
responses:
|
||||
400:
|
||||
description: Invalid request
|
||||
@@ -1100,11 +1100,11 @@ components:
|
||||
name: Name
|
||||
EnumClass:
|
||||
type: string
|
||||
default: -efg
|
||||
enum:
|
||||
- _abc
|
||||
- -efg
|
||||
- (xyz)
|
||||
default: -efg
|
||||
List:
|
||||
type: object
|
||||
properties:
|
||||
|
||||
@@ -29,11 +29,10 @@ type AnotherFakeApiService service
|
||||
AnotherFakeApiService To test special tags
|
||||
To test special tags
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
|
||||
* @param client client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
@@ -67,7 +66,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &client
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -97,7 +96,6 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Client
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -108,7 +106,6 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,13 @@
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"context"
|
||||
"github.com/antihax/optional"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@@ -26,27 +27,26 @@ var (
|
||||
|
||||
type FakeApiService service
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer boolean types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Interface of OuterBoolean) - Input boolean as post body
|
||||
|
||||
@return OuterBoolean
|
||||
* @param "BooleanPostBody" (optional.Bool) - Input boolean as post body
|
||||
@return bool
|
||||
*/
|
||||
|
||||
type FakeOuterBooleanSerializeOpts struct {
|
||||
Body optional.Interface
|
||||
type FakeOuterBooleanSerializeOpts struct {
|
||||
BooleanPostBody optional.Bool
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (OuterBoolean, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue OuterBoolean
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue bool
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -66,7 +66,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
localVarHttpHeaderAccepts := []string{"*/*"}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -74,14 +74,10 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
|
||||
|
||||
localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(OuterBoolean)
|
||||
if !localVarOptionalBodyok {
|
||||
return localVarReturnValue, nil, reportError("body should be OuterBoolean")
|
||||
}
|
||||
localVarPostBody = &localVarOptionalBody
|
||||
if localVarOptionals != nil && localVarOptionals.BooleanPostBody.IsSet() {
|
||||
localVarPostBody = localVarOptionals.BooleanPostBody.Value()
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -100,55 +96,52 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v OuterBoolean
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
var v bool
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of object with outer number type
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Interface of OuterComposite) - Input composite as post body
|
||||
|
||||
* @param "OuterComposite" (optional.Interface of OuterComposite) - Input composite as post body
|
||||
@return OuterComposite
|
||||
*/
|
||||
|
||||
type FakeOuterCompositeSerializeOpts struct {
|
||||
Body optional.Interface
|
||||
type FakeOuterCompositeSerializeOpts struct {
|
||||
OuterComposite optional.Interface
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue OuterComposite
|
||||
)
|
||||
|
||||
@@ -169,7 +162,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
localVarHttpHeaderAccepts := []string{"*/*"}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -177,14 +170,14 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
|
||||
|
||||
localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(OuterComposite)
|
||||
if !localVarOptionalBodyok {
|
||||
return localVarReturnValue, nil, reportError("body should be OuterComposite")
|
||||
if localVarOptionals != nil && localVarOptionals.OuterComposite.IsSet() {
|
||||
localVarOptionalOuterComposite, localVarOptionalOuterCompositeok := localVarOptionals.OuterComposite.Value().(OuterComposite)
|
||||
if !localVarOptionalOuterCompositeok {
|
||||
return localVarReturnValue, nil, reportError("outerComposite should be OuterComposite")
|
||||
}
|
||||
localVarPostBody = &localVarOptionalBody
|
||||
localVarPostBody = &localVarOptionalOuterComposite
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -203,56 +196,53 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v OuterComposite
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer number types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Interface of OuterNumber) - Input number as post body
|
||||
|
||||
@return OuterNumber
|
||||
* @param "Body" (optional.Float32) - Input number as post body
|
||||
@return float32
|
||||
*/
|
||||
|
||||
type FakeOuterNumberSerializeOpts struct {
|
||||
Body optional.Interface
|
||||
type FakeOuterNumberSerializeOpts struct {
|
||||
Body optional.Float32
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (OuterNumber, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue OuterNumber
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue float32
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -272,7 +262,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
localVarHttpHeaderAccepts := []string{"*/*"}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -281,13 +271,9 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
}
|
||||
// body params
|
||||
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
|
||||
|
||||
localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(OuterNumber)
|
||||
if !localVarOptionalBodyok {
|
||||
return localVarReturnValue, nil, reportError("body should be OuterNumber")
|
||||
}
|
||||
localVarPostBody = &localVarOptionalBody
|
||||
localVarPostBody = localVarOptionals.Body.Value()
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -306,56 +292,53 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v OuterNumber
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
var v float32
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService
|
||||
Test serialization of outer string types
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters:
|
||||
* @param "Body" (optional.Interface of OuterString) - Input string as post body
|
||||
|
||||
@return OuterString
|
||||
* @param "Body" (optional.String) - Input string as post body
|
||||
@return string
|
||||
*/
|
||||
|
||||
type FakeOuterStringSerializeOpts struct {
|
||||
Body optional.Interface
|
||||
type FakeOuterStringSerializeOpts struct {
|
||||
Body optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (OuterString, *http.Response, error) {
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue OuterString
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue string
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -375,7 +358,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
localVarHttpHeaderAccepts := []string{"*/*"}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -384,13 +367,9 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
}
|
||||
// body params
|
||||
if localVarOptionals != nil && localVarOptionals.Body.IsSet() {
|
||||
|
||||
localVarOptionalBody, localVarOptionalBodyok := localVarOptionals.Body.Value().(OuterString)
|
||||
if !localVarOptionalBodyok {
|
||||
return localVarReturnValue, nil, reportError("body should be OuterString")
|
||||
}
|
||||
localVarPostBody = &localVarOptionalBody
|
||||
localVarPostBody = localVarOptionals.Body.Value()
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -409,50 +388,45 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v OuterString
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
var v string
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body
|
||||
* @param query
|
||||
|
||||
|
||||
* @param user
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, body User, query string) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, user User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -481,7 +455,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, body User,
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &user
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -498,33 +472,30 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, body User,
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService To test \"client\" model
|
||||
To test \"client\" model
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
|
||||
* @param client client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Client
|
||||
)
|
||||
|
||||
@@ -553,7 +524,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &client
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -572,78 +543,73 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Client
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
/*
|
||||
FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param number None
|
||||
* @param double None
|
||||
* @param patternWithoutDelimiter None
|
||||
* @param byte_ None
|
||||
* @param byte None
|
||||
* @param optional nil or *TestEndpointParametersOpts - Optional Parameters:
|
||||
* @param "Integer" (optional.Int32) - None
|
||||
* @param "Int32_" (optional.Int32) - None
|
||||
* @param "Int64_" (optional.Int64) - None
|
||||
* @param "Float" (optional.Float32) - None
|
||||
* @param "String_" (optional.String) - None
|
||||
* @param "Binary" (optional.String) - None
|
||||
* @param "Date" (optional.String) - None
|
||||
* @param "DateTime" (optional.Time) - None
|
||||
* @param "Password" (optional.String) - None
|
||||
* @param "Callback" (optional.String) - None
|
||||
|
||||
|
||||
* @param "Integer" (optional.Int32) - None
|
||||
* @param "Int32" (optional.Int32) - None
|
||||
* @param "Int64" (optional.Int64) - None
|
||||
* @param "Float" (optional.Float32) - None
|
||||
* @param "String" (optional.String) - None
|
||||
* @param "Binary" (optional.Interface of *os.File) - None
|
||||
* @param "Date" (optional.String) - None
|
||||
* @param "DateTime" (optional.Time) - None
|
||||
* @param "Password" (optional.String) - None
|
||||
* @param "Callback" (optional.String) - None
|
||||
*/
|
||||
|
||||
type TestEndpointParametersOpts struct {
|
||||
Integer optional.Int32
|
||||
Int32_ optional.Int32
|
||||
Int64_ optional.Int64
|
||||
Float optional.Float32
|
||||
String_ optional.String
|
||||
Binary optional.String
|
||||
Date optional.String
|
||||
type TestEndpointParametersOpts struct {
|
||||
Integer optional.Int32
|
||||
Int32 optional.Int32
|
||||
Int64 optional.Int64
|
||||
Float optional.Float32
|
||||
String optional.String
|
||||
Binary optional.Interface
|
||||
Date optional.String
|
||||
DateTime optional.Time
|
||||
Password optional.String
|
||||
Callback optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -666,7 +632,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/xml; charset=utf-8", "application/json; charset=utf-8"}
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||
@@ -675,7 +641,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml; charset=utf-8", "application/json; charset=utf-8"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -685,24 +651,35 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
if localVarOptionals != nil && localVarOptionals.Integer.IsSet() {
|
||||
localVarFormParams.Add("integer", parameterToString(localVarOptionals.Integer.Value(), ""))
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.Int32_.IsSet() {
|
||||
localVarFormParams.Add("int32", parameterToString(localVarOptionals.Int32_.Value(), ""))
|
||||
if localVarOptionals != nil && localVarOptionals.Int32.IsSet() {
|
||||
localVarFormParams.Add("int32", parameterToString(localVarOptionals.Int32.Value(), ""))
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.Int64_.IsSet() {
|
||||
localVarFormParams.Add("int64", parameterToString(localVarOptionals.Int64_.Value(), ""))
|
||||
if localVarOptionals != nil && localVarOptionals.Int64.IsSet() {
|
||||
localVarFormParams.Add("int64", parameterToString(localVarOptionals.Int64.Value(), ""))
|
||||
}
|
||||
localVarFormParams.Add("number", parameterToString(number, ""))
|
||||
if localVarOptionals != nil && localVarOptionals.Float.IsSet() {
|
||||
localVarFormParams.Add("float", parameterToString(localVarOptionals.Float.Value(), ""))
|
||||
}
|
||||
localVarFormParams.Add("double", parameterToString(double, ""))
|
||||
if localVarOptionals != nil && localVarOptionals.String_.IsSet() {
|
||||
localVarFormParams.Add("string", parameterToString(localVarOptionals.String_.Value(), ""))
|
||||
if localVarOptionals != nil && localVarOptionals.String.IsSet() {
|
||||
localVarFormParams.Add("string", parameterToString(localVarOptionals.String.Value(), ""))
|
||||
}
|
||||
localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, ""))
|
||||
localVarFormParams.Add("byte", parameterToString(byte_, ""))
|
||||
localVarFormParams.Add("byte", parameterToString(byte, ""))
|
||||
var localVarFile *os.File
|
||||
if localVarOptionals != nil && localVarOptionals.Binary.IsSet() {
|
||||
localVarFormParams.Add("binary", parameterToString(localVarOptionals.Binary.Value(), ""))
|
||||
localVarFileOk := false
|
||||
localVarFile, localVarFileOk = localVarOptionals.Binary.Value().(*os.File)
|
||||
if !localVarFileOk {
|
||||
return nil, reportError("binary should be *os.File")
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
fbs, _ := ioutil.ReadAll(localVarFile)
|
||||
localVarFileBytes = fbs
|
||||
localVarFileName = localVarFile.Name()
|
||||
localVarFile.Close()
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.Date.IsSet() {
|
||||
localVarFormParams.Add("date", parameterToString(localVarOptionals.Date.Value(), ""))
|
||||
@@ -732,45 +709,41 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService To test enum parameters
|
||||
To test enum parameters
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param optional nil or *TestEnumParametersOpts - Optional Parameters:
|
||||
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
|
||||
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
|
||||
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
|
||||
* @param "EnumHeaderString" (optional.String) - Header parameter enum test (string)
|
||||
* @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array)
|
||||
* @param "EnumQueryString" (optional.String) - Query parameter enum test (string)
|
||||
* @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double)
|
||||
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
|
||||
|
||||
|
||||
* @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array)
|
||||
* @param "EnumHeaderString" (optional.String) - Header parameter enum test (string)
|
||||
* @param "EnumQueryStringArray" (optional.Interface of []string) - Query parameter enum test (string array)
|
||||
* @param "EnumQueryString" (optional.String) - Query parameter enum test (string)
|
||||
* @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double)
|
||||
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
|
||||
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
|
||||
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
|
||||
*/
|
||||
|
||||
type TestEnumParametersOpts struct {
|
||||
EnumFormStringArray optional.Interface
|
||||
EnumFormString optional.String
|
||||
type TestEnumParametersOpts struct {
|
||||
EnumHeaderStringArray optional.Interface
|
||||
EnumHeaderString optional.String
|
||||
EnumQueryStringArray optional.Interface
|
||||
EnumQueryString optional.String
|
||||
EnumQueryInteger optional.Int32
|
||||
EnumQueryDouble optional.Float64
|
||||
EnumHeaderString optional.String
|
||||
EnumQueryStringArray optional.Interface
|
||||
EnumQueryString optional.String
|
||||
EnumQueryInteger optional.Int32
|
||||
EnumQueryDouble optional.Float64
|
||||
EnumFormStringArray optional.Interface
|
||||
EnumFormString optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) {
|
||||
@@ -779,7 +752,6 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -798,8 +770,11 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
if localVarOptionals != nil && localVarOptionals.EnumQueryInteger.IsSet() {
|
||||
localVarQueryParams.Add("enum_query_integer", parameterToString(localVarOptionals.EnumQueryInteger.Value(), ""))
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.EnumQueryDouble.IsSet() {
|
||||
localVarQueryParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), ""))
|
||||
}
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"*/*"}
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||
@@ -808,7 +783,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"*/*"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -822,14 +797,11 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "")
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() {
|
||||
localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "csv"))
|
||||
localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), ""))
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() {
|
||||
localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), ""))
|
||||
}
|
||||
if localVarOptionals != nil && localVarOptionals.EnumQueryDouble.IsSet() {
|
||||
localVarFormParams.Add("enum_query_double", parameterToString(localVarOptionals.EnumQueryDouble.Value(), ""))
|
||||
}
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -846,34 +818,28 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService test inline additionalProperties
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param param request body
|
||||
|
||||
|
||||
* @param requestBody request body
|
||||
*/
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, param interface{}) (*http.Response, error) {
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody string) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -901,7 +867,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = ¶m
|
||||
localVarPostBody = &requestBody
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -918,27 +884,22 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarHttpResponse, nil
|
||||
}
|
||||
|
||||
/*
|
||||
/*
|
||||
FakeApiService test json serialization of form data
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
|
||||
|
||||
*/
|
||||
func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) {
|
||||
var (
|
||||
@@ -946,7 +907,6 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -957,7 +917,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
localVarFormParams := url.Values{}
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string{"application/json"}
|
||||
localVarHttpContentTypes := []string{"application/x-www-form-urlencoded"}
|
||||
|
||||
// set Content-Type header
|
||||
localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)
|
||||
@@ -991,13 +951,11 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
|
||||
@@ -29,11 +29,10 @@ type FakeClassnameTags123ApiService service
|
||||
FakeClassnameTags123ApiService To test class name in snake case
|
||||
To test class name in snake case
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body client model
|
||||
|
||||
* @param client client model
|
||||
@return Client
|
||||
*/
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body Client) (Client, *http.Response, error) {
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
@@ -67,7 +66,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &client
|
||||
if ctx != nil {
|
||||
// API Key Authentication
|
||||
if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {
|
||||
@@ -81,6 +80,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
localVarQueryParams.Add("api_key_query", key)
|
||||
}
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -110,7 +110,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Client
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -121,7 +120,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
|
||||
@@ -30,19 +30,15 @@ type PetApiService service
|
||||
|
||||
/*
|
||||
PetApiService Add a new pet to the store
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Pet object that needs to be added to the store
|
||||
|
||||
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, error) {
|
||||
func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -62,7 +58,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -70,7 +66,7 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &pet
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -87,13 +83,11 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -102,17 +96,14 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e
|
||||
|
||||
/*
|
||||
PetApiService Deletes a pet
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId Pet id to delete
|
||||
* @param optional nil or *DeletePetOpts - Optional Parameters:
|
||||
* @param "ApiKey" (optional.String) -
|
||||
|
||||
|
||||
* @param "ApiKey" (optional.String) -
|
||||
*/
|
||||
|
||||
type DeletePetOpts struct {
|
||||
ApiKey optional.String
|
||||
type DeletePetOpts struct {
|
||||
ApiKey optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) {
|
||||
@@ -121,7 +112,6 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -142,7 +132,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -168,13 +158,11 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -186,7 +174,6 @@ PetApiService Finds Pets by status
|
||||
Multiple status values can be provided with comma separated strings
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param status Status values that need to be considered for filter
|
||||
|
||||
@return []Pet
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) {
|
||||
@@ -252,7 +239,6 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v []Pet
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -263,7 +249,6 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -275,7 +260,6 @@ PetApiService Finds Pets by tags
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param tags Tags to filter by
|
||||
|
||||
@return []Pet
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) {
|
||||
@@ -341,7 +325,6 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v []Pet
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -352,7 +335,6 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -364,7 +346,6 @@ PetApiService Find pet by ID
|
||||
Returns a single pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to return
|
||||
|
||||
@return Pet
|
||||
*/
|
||||
func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) {
|
||||
@@ -414,6 +395,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -443,7 +425,6 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Pet
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -454,7 +435,6 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -463,19 +443,15 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
|
||||
/*
|
||||
PetApiService Update an existing pet
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Pet object that needs to be added to the store
|
||||
|
||||
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
*/
|
||||
func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response, error) {
|
||||
func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -495,7 +471,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -503,7 +479,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &pet
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -520,13 +496,11 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -535,19 +509,16 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response
|
||||
|
||||
/*
|
||||
PetApiService Updates a pet in the store with form data
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param optional nil or *UpdatePetWithFormOpts - Optional Parameters:
|
||||
* @param "Name" (optional.String) - Updated name of the pet
|
||||
* @param "Status" (optional.String) - Updated status of the pet
|
||||
|
||||
|
||||
* @param "Name" (optional.String) - Updated name of the pet
|
||||
* @param "Status" (optional.String) - Updated status of the pet
|
||||
*/
|
||||
|
||||
type UpdatePetWithFormOpts struct {
|
||||
Name optional.String
|
||||
Status optional.String
|
||||
type UpdatePetWithFormOpts struct {
|
||||
Name optional.String
|
||||
Status optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) {
|
||||
@@ -556,7 +527,6 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -577,7 +547,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -606,13 +576,11 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -621,19 +589,17 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
|
||||
/*
|
||||
PetApiService uploads an image
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId ID of pet to update
|
||||
* @param optional nil or *UploadFileOpts - Optional Parameters:
|
||||
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
|
||||
* @param "File" (optional.Interface of *os.File) - file to upload
|
||||
|
||||
* @param "AdditionalMetadata" (optional.String) - Additional data to pass to server
|
||||
* @param "File" (optional.Interface of *os.File) - file to upload
|
||||
@return ModelApiResponse
|
||||
*/
|
||||
|
||||
type UploadFileOpts struct {
|
||||
AdditionalMetadata optional.String
|
||||
File optional.Interface
|
||||
type UploadFileOpts struct {
|
||||
AdditionalMetadata optional.String
|
||||
File optional.Interface
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ModelApiResponse, *http.Response, error) {
|
||||
@@ -716,7 +682,6 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v ModelApiResponse
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -727,7 +692,6 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,6 @@ StoreApiService Delete purchase order by ID
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
|
||||
|
||||
*/
|
||||
func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) {
|
||||
var (
|
||||
@@ -40,7 +38,6 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -61,7 +58,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -84,13 +81,11 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -101,7 +96,6 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
StoreApiService Returns pet inventories by status
|
||||
Returns a map of status codes to quantities
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
|
||||
@return map[string]int32
|
||||
*/
|
||||
func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) {
|
||||
@@ -150,6 +144,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -179,7 +174,6 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v map[string]int32
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -190,7 +184,6 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -202,7 +195,6 @@ StoreApiService Find purchase order by ID
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
|
||||
@return Order
|
||||
*/
|
||||
func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) {
|
||||
@@ -274,7 +266,6 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Order
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -285,7 +276,6 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -294,13 +284,11 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
|
||||
/*
|
||||
StoreApiService Place an order for a pet
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body order placed for purchasing the pet
|
||||
|
||||
* @param order order placed for purchasing the pet
|
||||
@return Order
|
||||
*/
|
||||
func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *http.Response, error) {
|
||||
func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
@@ -334,7 +322,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &order
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return localVarReturnValue, nil, err
|
||||
@@ -364,7 +352,6 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Order
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -375,7 +362,6 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
|
||||
@@ -30,17 +30,14 @@ type UserApiService service
|
||||
UserApiService Create user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body Created user object
|
||||
|
||||
|
||||
* @param user Created user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -60,7 +57,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -68,7 +65,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &user
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -85,13 +82,11 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -100,19 +95,15 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo
|
||||
|
||||
/*
|
||||
UserApiService Creates list of users with given input array
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body List of user object
|
||||
|
||||
|
||||
* @param user List of user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -132,7 +123,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -140,7 +131,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &user
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -157,13 +148,11 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -172,19 +161,15 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U
|
||||
|
||||
/*
|
||||
UserApiService Creates list of users with given input array
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param body List of user object
|
||||
|
||||
|
||||
* @param user List of user object
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []User) (*http.Response, error) {
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -204,7 +189,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -212,7 +197,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &user
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -229,13 +214,11 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -247,8 +230,6 @@ UserApiService Delete user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The name that needs to be deleted
|
||||
|
||||
|
||||
*/
|
||||
func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) {
|
||||
var (
|
||||
@@ -256,7 +237,6 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -277,7 +257,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -300,13 +280,11 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -315,10 +293,8 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
|
||||
/*
|
||||
UserApiService Get user by user name
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
|
||||
@return User
|
||||
*/
|
||||
func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) {
|
||||
@@ -384,7 +360,6 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v User
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -395,7 +370,6 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -404,11 +378,9 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
|
||||
/*
|
||||
UserApiService Logs user into the system
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
|
||||
@return string
|
||||
*/
|
||||
func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) {
|
||||
@@ -475,7 +447,6 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v string
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
@@ -486,7 +457,6 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -495,10 +465,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
|
||||
/*
|
||||
UserApiService Logs out current logged in user session
|
||||
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
|
||||
|
||||
*/
|
||||
func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) {
|
||||
var (
|
||||
@@ -506,7 +473,6 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -526,7 +492,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -549,13 +515,11 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -567,17 +531,14 @@ UserApiService Updated user
|
||||
This can only be done by the logged in user.
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
|
||||
|
||||
* @param user Updated user object
|
||||
*/
|
||||
func (a *UserApiService) UpdateUser(ctx context.Context, username string, body User) (*http.Response, error) {
|
||||
func (a *UserApiService) UpdateUser(ctx context.Context, username string, user User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -598,7 +559,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
}
|
||||
|
||||
// to determine the Accept header
|
||||
localVarHttpHeaderAccepts := []string{"application/xml", "application/json"}
|
||||
localVarHttpHeaderAccepts := []string{}
|
||||
|
||||
// set Accept header
|
||||
localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)
|
||||
@@ -606,7 +567,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
// body params
|
||||
localVarPostBody = &body
|
||||
localVarPostBody = &user
|
||||
r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -623,13 +584,11 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U
|
||||
return localVarHttpResponse, err
|
||||
}
|
||||
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
||||
return localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **TestSpecialTags**
|
||||
> Client TestSpecialTags(ctx, body)
|
||||
> Client TestSpecialTags(ctx, client)
|
||||
To test special tags
|
||||
|
||||
To test special tags
|
||||
@@ -18,7 +18,7 @@ To test special tags
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **FakeOuterBooleanSerialize**
|
||||
> OuterBoolean FakeOuterBooleanSerialize(ctx, optional)
|
||||
> bool FakeOuterBooleanSerialize(ctx, optional)
|
||||
|
||||
|
||||
Test serialization of outer boolean types
|
||||
@@ -34,11 +34,11 @@ Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeO
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**optional.Interface of OuterBoolean**](OuterBoolean.md)| Input boolean as post body |
|
||||
**booleanPostBody** | **optional.Bool**| Input boolean as post body |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OuterBoolean**](OuterBoolean.md)
|
||||
**bool**
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -47,7 +47,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[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)
|
||||
|
||||
@@ -69,7 +69,7 @@ Optional parameters are passed through a pointer to a FakeOuterCompositeSerializ
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body |
|
||||
**outerComposite** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -82,12 +82,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[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)
|
||||
|
||||
# **FakeOuterNumberSerialize**
|
||||
> OuterNumber FakeOuterNumberSerialize(ctx, optional)
|
||||
> float32 FakeOuterNumberSerialize(ctx, optional)
|
||||
|
||||
|
||||
Test serialization of outer number types
|
||||
@@ -104,11 +104,11 @@ Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOp
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**optional.Interface of OuterNumber**](OuterNumber.md)| Input number as post body |
|
||||
**body** | **optional.Float32**| Input number as post body |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OuterNumber**](OuterNumber.md)
|
||||
**float32**
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -117,12 +117,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[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)
|
||||
|
||||
# **FakeOuterStringSerialize**
|
||||
> OuterString FakeOuterStringSerialize(ctx, optional)
|
||||
> string FakeOuterStringSerialize(ctx, optional)
|
||||
|
||||
|
||||
Test serialization of outer string types
|
||||
@@ -139,11 +139,11 @@ Optional parameters are passed through a pointer to a FakeOuterStringSerializeOp
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | [**optional.Interface of OuterString**](OuterString.md)| Input string as post body |
|
||||
**body** | **optional.String**| Input string as post body |
|
||||
|
||||
### Return type
|
||||
|
||||
[**OuterString**](OuterString.md)
|
||||
**string**
|
||||
|
||||
### Authorization
|
||||
|
||||
@@ -152,12 +152,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
- **Accept**: */*
|
||||
|
||||
[[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)
|
||||
|
||||
# **TestBodyWithQueryParams**
|
||||
> TestBodyWithQueryParams(ctx, body, query)
|
||||
> TestBodyWithQueryParams(ctx, query, user)
|
||||
|
||||
|
||||
### Required Parameters
|
||||
@@ -165,8 +165,8 @@ No authorization required
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**User**](User.md)| |
|
||||
**query** | **string**| |
|
||||
**user** | [**User**](User.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -184,7 +184,7 @@ No authorization required
|
||||
[[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)
|
||||
|
||||
# **TestClientModel**
|
||||
> Client TestClientModel(ctx, body)
|
||||
> Client TestClientModel(ctx, client)
|
||||
To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
@@ -194,7 +194,7 @@ To test \"client\" model
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -212,7 +212,7 @@ No authorization required
|
||||
[[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)
|
||||
|
||||
# **TestEndpointParameters**
|
||||
> TestEndpointParameters(ctx, number, double, patternWithoutDelimiter, byte_, optional)
|
||||
> TestEndpointParameters(ctx, number, double, patternWithoutDelimiter, byte, optional)
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
@@ -225,7 +225,7 @@ Name | Type | Description | Notes
|
||||
**number** | **float32**| None |
|
||||
**double** | **float64**| None |
|
||||
**patternWithoutDelimiter** | **string**| None |
|
||||
**byte_** | **string**| None |
|
||||
**byte** | **string**| None |
|
||||
**optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters
|
||||
|
||||
### Optional Parameters
|
||||
@@ -238,11 +238,11 @@ Name | Type | Description | Notes
|
||||
|
||||
|
||||
**integer** | **optional.Int32**| None |
|
||||
**int32_** | **optional.Int32**| None |
|
||||
**int64_** | **optional.Int64**| None |
|
||||
**int32** | **optional.Int32**| None |
|
||||
**int64** | **optional.Int64**| None |
|
||||
**float** | **optional.Float32**| None |
|
||||
**string_** | **optional.String**| None |
|
||||
**binary** | **optional.String**| None |
|
||||
**string** | **optional.String**| None |
|
||||
**binary** | **optional.Interface of *os.File****optional.*os.File**| None |
|
||||
**date** | **optional.String**| None |
|
||||
**dateTime** | **optional.Time**| None |
|
||||
**password** | **optional.String**| None |
|
||||
@@ -258,8 +258,8 @@ Name | Type | Description | Notes
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **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)
|
||||
|
||||
@@ -281,14 +281,14 @@ Optional parameters are passed through a pointer to a TestEnumParametersOpts str
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumFormStringArray** | [**optional.Interface of []string**](string.md)| Form parameter enum test (string array) |
|
||||
**enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg]
|
||||
**enumHeaderStringArray** | [**optional.Interface of []string**](string.md)| Header parameter enum test (string array) |
|
||||
**enumHeaderString** | **optional.String**| Header parameter enum test (string) | [default to -efg]
|
||||
**enumQueryStringArray** | [**optional.Interface of []string**](string.md)| Query parameter enum test (string array) |
|
||||
**enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg]
|
||||
**enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) |
|
||||
**enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) |
|
||||
**enumFormStringArray** | [**optional.Interface of []string**](array.md)| Form parameter enum test (string array) |
|
||||
**enumFormString** | **optional.String**| Form parameter enum test (string) |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -300,23 +300,21 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: */*
|
||||
- **Accept**: */*
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **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)
|
||||
|
||||
# **TestInlineAdditionalProperties**
|
||||
> TestInlineAdditionalProperties(ctx, param)
|
||||
> TestInlineAdditionalProperties(ctx, requestBody)
|
||||
test inline additionalProperties
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**param** | [**interface{}**](interface{}.md)| request body |
|
||||
**requestBody** | [**string**](string.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -337,8 +335,6 @@ No authorization required
|
||||
> TestJsonFormData(ctx, param, param2)
|
||||
test json serialization of form data
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
@@ -357,7 +353,7 @@ No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **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)
|
||||
|
||||
@@ -8,7 +8,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **TestClassname**
|
||||
> Client TestClassname(ctx, body)
|
||||
> Client TestClassname(ctx, client)
|
||||
To test class name in snake case
|
||||
|
||||
To test class name in snake case
|
||||
@@ -18,7 +18,7 @@ To test class name in snake case
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**Client**](Client.md)| client model |
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ Name | Type | Description | Notes
|
||||
**Double** | **float64** | | [optional] [default to null]
|
||||
**String_** | **string** | | [optional] [default to null]
|
||||
**Byte_** | **string** | | [default to null]
|
||||
**Binary** | **string** | | [optional] [default to null]
|
||||
**Binary** | [****os.File**](*os.File.md) | | [optional] [default to null]
|
||||
**Date** | **string** | | [default to null]
|
||||
**DateTime** | [**time.Time**](time.Time.md) | | [optional] [default to null]
|
||||
**Uuid** | **string** | | [optional] [default to null]
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**MyNumber** | [***OuterNumber**](OuterNumber.md) | | [optional] [default to null]
|
||||
**MyString** | [***OuterString**](OuterString.md) | | [optional] [default to null]
|
||||
**MyBoolean** | [***OuterBoolean**](OuterBoolean.md) | | [optional] [default to null]
|
||||
**MyNumber** | **float32** | | [optional] [default to null]
|
||||
**MyString** | **string** | | [optional] [default to null]
|
||||
**MyBoolean** | **bool** | | [optional] [default to null]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -15,17 +15,15 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **AddPet**
|
||||
> AddPet(ctx, body)
|
||||
> AddPet(ctx, pet)
|
||||
Add a new pet to the store
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -38,7 +36,7 @@ Name | Type | Description | Notes
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -46,8 +44,6 @@ Name | Type | Description | Notes
|
||||
> DeletePet(ctx, petId, optional)
|
||||
Deletes a pet
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
@@ -75,7 +71,7 @@ Name | Type | Description | Notes
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -164,17 +160,15 @@ Name | Type | Description | Notes
|
||||
[[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)
|
||||
|
||||
# **UpdatePet**
|
||||
> UpdatePet(ctx, body)
|
||||
> UpdatePet(ctx, pet)
|
||||
Update an existing pet
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -187,7 +181,7 @@ Name | Type | Description | Notes
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -195,8 +189,6 @@ Name | Type | Description | Notes
|
||||
> UpdatePetWithForm(ctx, petId, optional)
|
||||
Updates a pet in the store with form data
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
@@ -225,7 +217,7 @@ Name | Type | Description | Notes
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -233,8 +225,6 @@ Name | Type | Description | Notes
|
||||
> ModelApiResponse UploadFile(ctx, petId, optional)
|
||||
uploads an image
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
@@ -250,7 +240,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
|
||||
**additionalMetadata** | **optional.String**| Additional data to pass to server |
|
||||
**file** | **optional.Interface of *os.File**| file to upload |
|
||||
**file** | **optional.Interface of *os.File****optional.*os.File**| file to upload |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -91,17 +91,15 @@ No authorization required
|
||||
[[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)
|
||||
|
||||
# **PlaceOrder**
|
||||
> Order PlaceOrder(ctx, body)
|
||||
> Order PlaceOrder(ctx, order)
|
||||
Place an order for a pet
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ Method | HTTP request | Description
|
||||
|
||||
|
||||
# **CreateUser**
|
||||
> CreateUser(ctx, body)
|
||||
> CreateUser(ctx, user)
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
@@ -25,7 +25,7 @@ This can only be done by the logged in user.
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**User**](User.md)| Created user object |
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -38,22 +38,20 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
# **CreateUsersWithArrayInput**
|
||||
> CreateUsersWithArrayInput(ctx, body)
|
||||
> CreateUsersWithArrayInput(ctx, user)
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**[]User**](User.md)| List of user object |
|
||||
**user** | [**[]User**](array.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -66,22 +64,20 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
# **CreateUsersWithListInput**
|
||||
> CreateUsersWithListInput(ctx, body)
|
||||
> CreateUsersWithListInput(ctx, user)
|
||||
Creates list of users with given input array
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**body** | [**[]User**](User.md)| List of user object |
|
||||
**user** | [**[]User**](array.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -94,7 +90,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -122,7 +118,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
@@ -130,8 +126,6 @@ No authorization required
|
||||
> User GetUserByName(ctx, username)
|
||||
Get user by user name
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
@@ -158,8 +152,6 @@ No authorization required
|
||||
> string LoginUser(ctx, username, password)
|
||||
Logs user into the system
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
@@ -187,8 +179,6 @@ No authorization required
|
||||
> LogoutUser(ctx, )
|
||||
Logs out current logged in user session
|
||||
|
||||
|
||||
|
||||
### Required Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
@@ -203,12 +193,12 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
# **UpdateUser**
|
||||
> UpdateUser(ctx, username, body)
|
||||
> UpdateUser(ctx, username, user)
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
@@ -219,7 +209,7 @@ Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
|
||||
**username** | **string**| name that need to be deleted |
|
||||
**body** | [**User**](User.md)| Updated user object |
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
@@ -232,7 +222,7 @@ No authorization required
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
- **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)
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type EnumClass string
|
||||
|
||||
// List of EnumClass
|
||||
@@ -17,4 +16,4 @@ const (
|
||||
ABC EnumClass = "_abc"
|
||||
EFG EnumClass = "-efg"
|
||||
XYZ EnumClass = "(xyz)"
|
||||
)
|
||||
)
|
||||
@@ -9,8 +9,8 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -23,7 +23,7 @@ type FormatTest struct {
|
||||
Double float64 `json:"double,omitempty"`
|
||||
String_ string `json:"string,omitempty"`
|
||||
Byte_ string `json:"byte"`
|
||||
Binary string `json:"binary,omitempty"`
|
||||
Binary **os.File `json:"binary,omitempty"`
|
||||
Date string `json:"date"`
|
||||
DateTime time.Time `json:"dateTime,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
package petstore
|
||||
|
||||
type OuterComposite struct {
|
||||
MyNumber *OuterNumber `json:"my_number,omitempty"`
|
||||
MyString *OuterString `json:"my_string,omitempty"`
|
||||
MyBoolean *OuterBoolean `json:"my_boolean,omitempty"`
|
||||
MyNumber float32 `json:"my_number,omitempty"`
|
||||
MyString string `json:"my_string,omitempty"`
|
||||
MyBoolean bool `json:"my_boolean,omitempty"`
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type OuterEnum string
|
||||
|
||||
// List of OuterEnum
|
||||
@@ -17,4 +16,4 @@ const (
|
||||
PLACED OuterEnum = "placed"
|
||||
APPROVED OuterEnum = "approved"
|
||||
DELIVERED OuterEnum = "delivered"
|
||||
)
|
||||
)
|
||||
@@ -111,6 +111,7 @@ Class | Method | HTTP request | Description
|
||||
|
||||
- [Petstore::AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||
- [Petstore::Animal](docs/Animal.md)
|
||||
- [Petstore::AnimalFarm](docs/AnimalFarm.md)
|
||||
- [Petstore::ApiResponse](docs/ApiResponse.md)
|
||||
- [Petstore::ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||
- [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||
|
||||
@@ -19,6 +19,7 @@ require 'petstore/configuration'
|
||||
# Models
|
||||
require 'petstore/models/additional_properties_class'
|
||||
require 'petstore/models/animal'
|
||||
require 'petstore/models/animal_farm'
|
||||
require 'petstore/models/api_response'
|
||||
require 'petstore/models/array_of_array_of_number_only'
|
||||
require 'petstore/models/array_of_number_only'
|
||||
|
||||
Reference in New Issue
Block a user