diff --git a/bin/go-petstore-withxml.sh b/bin/go-petstore-withxml.sh index 0e5390b5fc..222fd35cf2 100755 --- a/bin/go-petstore-withxml.sh +++ b/bin/go-petstore-withxml.sh @@ -30,6 +30,6 @@ rm -rf samples/client/petstore/go/go-petstore-withXml # if you've executed sbt assembly previously it will use that instead. export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore-withXml -DpackageName=petstore,withXml=true $@" +ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore-withXml -DpackageName=petstore,withXml=true,withGoCodegenComment=true $@" java $JAVA_OPTS -jar $executable $ags diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java index 0d5780a775..34676479f3 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenConstants.java @@ -56,6 +56,9 @@ public class CodegenConstants { public static final String PYTHON_PACKAGE_NAME = "pythonPackageName"; public static final String PYTHON_PACKAGE_NAME_DESC = "package name for generated python code"; + public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; + public static final String WITH_GO_CODEGEN_COMMENT_DESC = "whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs"; + public static final String GROUP_ID = "groupId"; public static final String GROUP_ID_DESC = "groupId in generated pom.xml"; diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java index dc288e74dd..a710c6c852 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractGoCodegen.java @@ -37,6 +37,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege private static final Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class); + protected boolean withGoCodegenComment = false; protected boolean withXml = false; protected String packageName = "openapi"; @@ -584,6 +585,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } } + public void setWithGoCodegenComment(boolean withGoCodegenComment) { + this.withGoCodegenComment = withGoCodegenComment; + } + public void setWithXml(boolean withXml) { this.withXml = withXml; } diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java index ff5765b465..dd173e43cc 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GoClientCodegen.java @@ -30,6 +30,7 @@ public class GoClientCodegen extends AbstractGoCodegen { protected String packageVersion = "1.0.0"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; + public static final String WITH_GO_CODEGEN_COMMENT = "withGoCodegenComment"; public static final String WITH_XML = "withXml"; public GoClientCodegen() { @@ -49,8 +50,10 @@ public class GoClientCodegen extends AbstractGoCodegen { cliOptions.add(new CliOption(CodegenConstants.PACKAGE_VERSION, "Go package version.") .defaultValue("1.0.0")); + cliOptions.add(CliOption.newBoolean(WITH_GO_CODEGEN_COMMENT, "whether to include Go codegen comment to disable Go Lint and collapse by default GitHub in PRs and diffs")); cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); + // option to change the order of form/body parameter cliOptions.add(CliOption.newBoolean( CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, @@ -93,6 +96,13 @@ public class GoClientCodegen extends AbstractGoCodegen { supportingFiles.add(new SupportingFile("response.mustache", "", "response.go")); supportingFiles.add(new SupportingFile(".travis.yml", "", ".travis.yml")); + if (additionalProperties.containsKey(WITH_GO_CODEGEN_COMMENT)) { + setWithGoCodegenComment(Boolean.parseBoolean(additionalProperties.get(WITH_GO_CODEGEN_COMMENT).toString())); + if (withGoCodegenComment) { + additionalProperties.put(WITH_GO_CODEGEN_COMMENT, "true"); + } + } + if (additionalProperties.containsKey(WITH_XML)) { setWithXml(Boolean.parseBoolean(additionalProperties.get(WITH_XML).toString())); if (withXml) { diff --git a/modules/openapi-generator/src/main/resources/go/partial_header.mustache b/modules/openapi-generator/src/main/resources/go/partial_header.mustache index 23edcdfb69..e23b21520a 100644 --- a/modules/openapi-generator/src/main/resources/go/partial_header.mustache +++ b/modules/openapi-generator/src/main/resources/go/partial_header.mustache @@ -13,5 +13,11 @@ {{#infoEmail}} * Contact: {{{infoEmail}}} {{/infoEmail}} +{{^withGoCodegenComment}} * Generated by: OpenAPI Generator (https://openapi-generator.tech) +{{/withGoCodegenComment}} */ +{{#withGoCodegenComment}} + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +{{/withGoCodegenComment}} diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java index 9b8a33b1b0..a86cae6fde 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/go/GoClientOptionsTest.java @@ -47,6 +47,8 @@ public class GoClientOptionsTest extends AbstractOptionsTest { times = 1; clientCodegen.setPackageName(GoClientOptionsProvider.PACKAGE_NAME_VALUE); times = 1; + clientCodegen.setWithGoCodegenComment(GoClientOptionsProvider.WITH_GO_CODEGEN_COMMENT_VALUE); + times = 1; clientCodegen.setWithXml(GoClientOptionsProvider.WITH_XML_VALUE); times = 1; clientCodegen.setPrependFormOrBodyParameters(Boolean.valueOf(GoClientOptionsProvider.PREPEND_FORM_OR_BODY_PARAMETERS_VALUE)); diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java index feedadf500..ed96aa800d 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/options/GoClientOptionsProvider.java @@ -28,6 +28,7 @@ public class GoClientOptionsProvider implements OptionsProvider { public static final String PACKAGE_VERSION_VALUE = "1.0.0"; public static final String PACKAGE_NAME_VALUE = "Go"; + public static final boolean WITH_GO_CODEGEN_COMMENT_VALUE = true; public static final boolean WITH_XML_VALUE = true; public static final Boolean PREPEND_FORM_OR_BODY_PARAMETERS_VALUE = true; @@ -43,6 +44,7 @@ public class GoClientOptionsProvider implements OptionsProvider { .put(CodegenConstants.PACKAGE_VERSION, PACKAGE_VERSION_VALUE) .put(CodegenConstants.PACKAGE_NAME, PACKAGE_NAME_VALUE) .put(CodegenConstants.HIDE_GENERATION_TIMESTAMP, "true") + .put(CodegenConstants.WITH_GO_CODEGEN_COMMENT, "true") .put(CodegenConstants.WITH_XML, "true") .put(CodegenConstants.PREPEND_FORM_OR_BODY_PARAMETERS, "true") .build(); diff --git a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION index 0628777500..dde25ef08e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.openapi-generator/VERSION @@ -1 +1 @@ -3.1.0-SNAPSHOT \ No newline at end of file +3.1.1-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml index d8726d724f..1843427a4f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/openapi.yaml @@ -1008,12 +1008,12 @@ paths: additionalMetadata: description: Additional data to pass to server type: string - file: + requiredFile: description: file to upload format: binary type: string required: - - file + - requiredFile required: true responses: 200: @@ -1507,6 +1507,7 @@ components: $ref: '#/components/schemas/Animal' type: array File: + description: Must be named `File` for test. example: sourceURI: sourceURI properties: diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go index b9676e5e8b..947356f0b8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -34,9 +35,10 @@ To test special tags func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Client ) @@ -66,7 +68,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Clie } // body params localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index 52536427da..5802c0ab47 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -42,9 +43,10 @@ type FakeOuterBooleanSerializeOpts struct { func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue bool ) @@ -77,7 +79,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -138,9 +140,10 @@ type FakeOuterCompositeSerializeOpts struct { func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue OuterComposite ) @@ -177,7 +180,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV localVarPostBody = &localVarOptionalOuterComposite } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -238,9 +241,10 @@ type FakeOuterNumberSerializeOpts struct { func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue float32 ) @@ -273,7 +277,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -334,9 +338,10 @@ type FakeOuterStringSerializeOpts struct { func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue string ) @@ -369,7 +374,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO localVarPostBody = localVarOptionals.Body.Value() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -423,9 +428,10 @@ For this test, the body for this request much reference a schema named `Fil func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -454,7 +460,7 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaT } // body params localVarPostBody = &fileSchemaTestClass - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -490,9 +496,10 @@ FakeApiService 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 + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -522,7 +529,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -559,9 +566,10 @@ To test \"client\" model func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Client ) @@ -591,7 +599,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl } // body params localVarPostBody = &client - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -673,9 +681,10 @@ type TestEndpointParametersOpts struct { 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 + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -733,6 +742,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa } localVarFormParams.Add("pattern_without_delimiter", parameterToString(patternWithoutDelimiter, "")) localVarFormParams.Add("byte", parameterToString(byte_, "")) + localVarFormFileName = "binary" var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.Binary.IsSet() { localVarFileOk := false @@ -759,7 +769,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa if localVarOptionals != nil && localVarOptionals.Callback.IsSet() { localVarFormParams.Add("callback", parameterToString(localVarOptionals.Callback.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -815,9 +825,10 @@ type TestEnumParametersOpts struct { func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -868,7 +879,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -903,9 +914,10 @@ FakeApiService test inline additionalProperties func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -934,7 +946,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req } // body params localVarPostBody = &requestBody - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -970,9 +982,10 @@ FakeApiService test json serialization of form data func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -1001,7 +1014,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par } localVarFormParams.Add("param", parameterToString(param, "")) localVarFormParams.Add("param2", parameterToString(param2, "")) - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go index 78a0effb2b..b2748822bb 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -34,9 +35,10 @@ To test class name in snake case func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Client ) @@ -79,7 +81,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie } } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go index 9c933feeb5..2a7fc7f017 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -35,9 +36,10 @@ PetApiService Add a new pet to the store func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -66,7 +68,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er } // body params localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -108,9 +110,10 @@ type DeletePetOpts struct { func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -141,7 +144,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti if localVarOptionals != nil && localVarOptionals.ApiKey.IsSet() { localVarHeaderParams["api_key"] = parameterToString(localVarOptionals.ApiKey.Value(), "") } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -178,9 +181,10 @@ Multiple status values can be provided with comma separated strings func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue []Pet ) @@ -209,7 +213,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -264,9 +268,10 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue []Pet ) @@ -295,7 +300,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -350,9 +355,10 @@ Returns a single pet func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Pet ) @@ -394,7 +400,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) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -447,9 +453,10 @@ PetApiService Update an existing pet func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -478,7 +485,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, } // body params localVarPostBody = &pet - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -522,9 +529,10 @@ type UpdatePetWithFormOpts struct { func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -558,7 +566,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca if localVarOptionals != nil && localVarOptionals.Status.IsSet() { localVarFormParams.Add("status", parameterToString(localVarOptionals.Status.Value(), "")) } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -603,9 +611,10 @@ type UploadFileOpts struct { func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue ApiResponse ) @@ -637,6 +646,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) } + localVarFormFileName = "file" var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.File.IsSet() { localVarFileOk := false @@ -651,7 +661,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -700,7 +710,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt PetApiService uploads an image (required) * @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 file file to upload + * @param requiredFile file to upload * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server @return ApiResponse @@ -710,12 +720,13 @@ type UploadFileWithRequiredFileOpts struct { AdditionalMetadata optional.String } -func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, file *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue ApiResponse ) @@ -747,14 +758,15 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) } - localVarFile := file + localVarFormFileName = "requiredFile" + localVarFile := requiredFile if localVarFile != nil { fbs, _ := ioutil.ReadAll(localVarFile) localVarFileBytes = fbs localVarFileName = localVarFile.Name() localVarFile.Close() } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go index e628e13428..37bfbd9d1e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -34,9 +35,10 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -64,7 +66,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -100,9 +102,10 @@ Returns a map of status codes to quantities func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue map[string]int32 ) @@ -143,7 +146,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) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -198,9 +201,10 @@ For valid response try integer IDs with value <= 5 or > 10. Other val func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Order ) @@ -235,7 +239,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -289,9 +293,10 @@ StoreApiService Place an order for a pet func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue Order ) @@ -321,7 +326,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, * } // body params localVarPostBody = &order - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go index c24eeacc70..5fb7bae889 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -34,9 +35,10 @@ This can only be done by the logged in user. func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -65,7 +67,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -100,9 +102,10 @@ UserApiService Creates list of users with given input array func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -131,7 +134,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -166,9 +169,10 @@ UserApiService Creates list of users with given input array func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -197,7 +201,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -233,9 +237,10 @@ This can only be done by the logged in user. func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -263,7 +268,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -299,9 +304,10 @@ UserApiService Get user by user name func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue User ) @@ -330,7 +336,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -385,9 +391,10 @@ UserApiService Logs user into the system func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte localVarReturnValue string ) @@ -417,7 +424,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return localVarReturnValue, nil, err } @@ -469,9 +476,10 @@ UserApiService Logs out current logged in user session func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -498,7 +506,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) if localVarHttpHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHttpHeaderAccept } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } @@ -535,9 +543,10 @@ This can only be done by the logged in user. 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 + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte ) // create path and map variables @@ -567,7 +576,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, user U } // body params localVarPostBody = &user - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) if err != nil { return nil, err } diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index c3908518e9..7f6ae237a7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( @@ -153,6 +154,8 @@ func parameterToString(obj interface{}, collectionFormat string) string { if reflect.TypeOf(obj).Kind() == reflect.Slice { return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) } return fmt.Sprintf("%v", obj) @@ -176,6 +179,7 @@ func (c *APIClient) prepareRequest( headerParams map[string]string, queryParams url.Values, formParams url.Values, + formFileName string, fileName string, fileBytes []byte) (localVarRequest *http.Request, err error) { @@ -218,7 +222,7 @@ func (c *APIClient) prepareRequest( if len(fileBytes) > 0 && fileName != "" { w.Boundary() //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile("file", filepath.Base(fileName)) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) if err != nil { return nil, err } @@ -438,8 +442,9 @@ func CacheExpires(r *http.Response) time.Time { lifetime, err := time.ParseDuration(maxAge + "s") if err != nil { expires = now + } else { + expires = now.Add(lifetime) } - expires = now.Add(lifetime) } else { expiresHeader := r.Header.Get("Expires") if expiresHeader != "" { diff --git a/samples/client/petstore/go/go-petstore-withXml/configuration.go b/samples/client/petstore/go/go-petstore-withXml/configuration.go index 19ccc325fa..3819712b07 100644 --- a/samples/client/petstore/go/go-petstore-withXml/configuration.go +++ b/samples/client/petstore/go/go-petstore-withXml/configuration.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md index 327cc1739c..481ce5e80e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md @@ -259,7 +259,7 @@ 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) # **UploadFileWithRequiredFile** -> ApiResponse UploadFileWithRequiredFile(ctx, petId, file, optional) +> ApiResponse UploadFileWithRequiredFile(ctx, petId, requiredFile, optional) uploads an image (required) ### Required Parameters @@ -268,7 +268,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| ID of pet to update | - **file** | ***os.File*****os.File**| file to upload | + **requiredFile** | ***os.File*****os.File**| file to upload | **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters ### Optional Parameters diff --git a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go index ee0b7ff827..c595db8077 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_200_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_200_response.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Model for testing model name starting with number diff --git a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go index e5e0dc313d..afa3de3d95 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_additional_properties_class.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type AdditionalPropertiesClass struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_animal.go b/samples/client/petstore/go/go-petstore-withXml/model_animal.go index 7963f94735..69c91c1b35 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_animal.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_animal.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Animal struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_animal_farm.go b/samples/client/petstore/go/go-petstore-withXml/model_animal_farm.go index e3ff77813e..a6631942e3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_animal_farm.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_animal_farm.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type AnimalFarm struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go index 7e312fda72..9f617359fd 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_api_response.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_api_response.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type ApiResponse struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go index 38eeea6410..ed5167ff2d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_array_of_number_only.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type ArrayOfArrayOfNumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go index a0ad11daa3..1c23a80552 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_of_number_only.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type ArrayOfNumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go index a8a09bcad9..3a0f7178d2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_array_test_.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type ArrayTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go index 1b0d12cc5b..66c5fc6c14 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_capitalization.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Capitalization struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_cat.go b/samples/client/petstore/go/go-petstore-withXml/model_cat.go index dfbfc92f7b..f59648881a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_cat.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_cat.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Cat struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_category.go b/samples/client/petstore/go/go-petstore-withXml/model_category.go index 10b89f3d7e..2da34c43a2 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_category.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_category.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Category struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go index cc17f5274b..8c7a002dd3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_class_model.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_class_model.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Model for testing model with \"_class\" property diff --git a/samples/client/petstore/go/go-petstore-withXml/model_client.go b/samples/client/petstore/go/go-petstore-withXml/model_client.go index d6fcafc867..e41f7052af 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_client.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_client.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Client struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_dog.go b/samples/client/petstore/go/go-petstore-withXml/model_dog.go index c65af49257..8191c278bb 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_dog.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_dog.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Dog struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go index d352a219d5..f4c7e5495c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_arrays.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type EnumArrays struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go index 534ce43288..9d3dd60a94 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_class.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type EnumClass string diff --git a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go index a9e3f2555b..02c6c920c3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_enum_test_.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type EnumTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file.go b/samples/client/petstore/go/go-petstore-withXml/model_file.go index 8b8123b47a..f1d827d1e7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file.go @@ -4,11 +4,13 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore +// Must be named `File` for test. type File struct { // Test capitalization SourceURI string `json:"sourceURI,omitempty" xml:"sourceURI"` diff --git a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go index 1c30a21fd4..6debdd3639 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_file_schema_test_class.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type FileSchemaTestClass struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go index 9bfa6008c2..dbd780a794 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_format_test_.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( "os" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go index 852b01c849..15edfc4349 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_has_only_read_only.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type HasOnlyReadOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_list.go b/samples/client/petstore/go/go-petstore-withXml/model_list.go index 782133b35c..86b6d67a5f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_list.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_list.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type List struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go index d8b5f96c42..a15240d0d7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_map_test_.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type MapTest struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go index 5ec5eea193..099ebd1c28 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_mixed_properties_and_additional_properties_class.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( "time" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_name.go index 0ff30773cd..684f282beb 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_name.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Model for testing model name same as property name diff --git a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go index 51113b205b..9148cddf4a 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_number_only.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_number_only.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type NumberOnly struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_order.go b/samples/client/petstore/go/go-petstore-withXml/model_order.go index dd4c290a4e..c4a731b72c 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_order.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_order.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import ( "time" diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go index f502c5af53..0a6cc434b9 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_composite.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type OuterComposite struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go index 903d31e826..c6b28556bf 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_outer_enum.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type OuterEnum string diff --git a/samples/client/petstore/go/go-petstore-withXml/model_pet.go b/samples/client/petstore/go/go-petstore-withXml/model_pet.go index ca15bb5e8a..eb0d4085f7 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_pet.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Pet struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go index 5cf4987f03..47da7a75c8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_read_only_first.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type ReadOnlyFirst struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_return.go b/samples/client/petstore/go/go-petstore-withXml/model_return.go index 407b840f75..7ec34d521e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_return.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_return.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore // Model for testing reserved words diff --git a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go index d4940064a0..be2037eb68 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_special_model_name.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type SpecialModelName struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go b/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go index 7cc08c7e89..35c10ad518 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_string_boolean_map.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type StringBooleanMap struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_tag.go b/samples/client/petstore/go/go-petstore-withXml/model_tag.go index 940f70e4e3..fb2232a6bf 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_tag.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_tag.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type Tag struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/model_user.go b/samples/client/petstore/go/go-petstore-withXml/model_user.go index 1f0a09f34f..27f1f67e42 100644 --- a/samples/client/petstore/go/go-petstore-withXml/model_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/model_user.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore type User struct { diff --git a/samples/client/petstore/go/go-petstore-withXml/response.go b/samples/client/petstore/go/go-petstore-withXml/response.go index 38f373df75..44caa48b0f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/response.go +++ b/samples/client/petstore/go/go-petstore-withXml/response.go @@ -4,9 +4,10 @@ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) */ +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + package petstore import (