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 17e89949d45..c2b8150dc5d 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 @@ -35,12 +35,14 @@ import static org.openapitools.codegen.utils.StringUtils.underscore; public abstract class AbstractGoCodegen extends DefaultCodegen implements CodegenConfig { private static final Logger LOGGER = LoggerFactory.getLogger(AbstractGoCodegen.class); + private static final String NUMERIC_ENUM_PREFIX = "_"; protected boolean withGoCodegenComment = false; protected boolean withXml = false; protected boolean enumClassPrefix = false; protected String packageName = "openapi"; + protected Set numberTypes; public AbstractGoCodegen() { super(); @@ -110,6 +112,13 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege typeMapping.put("ByteArray", "string"); typeMapping.put("object", "map[string]interface{}"); + numberTypes = new HashSet( + Arrays.asList( + "uint", "uint8", "uint16", "uint32", "uint64", + "int", "int8", "int16","int32", "int64", + "float32", "float64") + ); + importMapping = new HashMap(); cliOptions.clear(); @@ -560,10 +569,10 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege @Override public String toEnumValue(String value, String datatype) { - if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + if (isNumberType(datatype) || "bool".equals(datatype)) { return value; } else { - return escapeText(value); + return "\"" + escapeText(value) + "\""; } } @@ -579,12 +588,12 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } // number - if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + if (isNumberType(datatype)) { String varName = name; varName = varName.replaceAll("-", "MINUS_"); varName = varName.replaceAll("\\+", "PLUS_"); varName = varName.replaceAll("\\.", "_DOT_"); - return varName; + return NUMERIC_ENUM_PREFIX + varName; } // for symbol, e.g. $, # @@ -600,7 +609,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege if (isReservedWord(enumName)) { // reserved word return escapeReservedWord(enumName); } else if (enumName.matches("\\d.*")) { // starts with a number - return "_" + enumName; + return NUMERIC_ENUM_PREFIX + enumName; } else { return enumName; } @@ -614,7 +623,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege enumName = enumName.replace("[]", ""); if (enumName.matches("\\d.*")) { // starts with number - return "_" + enumName; + return NUMERIC_ENUM_PREFIX + enumName; } else { return enumName; } @@ -682,4 +691,8 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege } } } + + protected boolean isNumberType(String datatype) { + return numberTypes.contains(datatype); + } } diff --git a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache index 2b97b31b3cf..65267d0e483 100644 --- a/modules/openapi-generator/src/main/resources/go-experimental/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-experimental/model.mustache @@ -21,7 +21,7 @@ const ( {{#enumVars}} {{^-first}} {{/-first}} - {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = "{{{value}}}" + {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ) diff --git a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache index 38408680231..b6ae9ba9f34 100644 --- a/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-gin-server/model.mustache @@ -11,7 +11,7 @@ type {{{name}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/form const ( {{#allowableValues}} {{#enumVars}} - {{name}} {{{classname}}} = "{{{value}}}" + {{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} diff --git a/modules/openapi-generator/src/main/resources/go-server/model.mustache b/modules/openapi-generator/src/main/resources/go-server/model.mustache index 38408680231..b6ae9ba9f34 100644 --- a/modules/openapi-generator/src/main/resources/go-server/model.mustache +++ b/modules/openapi-generator/src/main/resources/go-server/model.mustache @@ -11,7 +11,7 @@ type {{{name}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/form const ( {{#allowableValues}} {{#enumVars}} - {{name}} {{{classname}}} = "{{{value}}}" + {{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} diff --git a/modules/openapi-generator/src/main/resources/go/model.mustache b/modules/openapi-generator/src/main/resources/go/model.mustache index 72359c5700c..201fd507ff9 100644 --- a/modules/openapi-generator/src/main/resources/go/model.mustache +++ b/modules/openapi-generator/src/main/resources/go/model.mustache @@ -21,7 +21,7 @@ const ( {{#enumVars}} {{^-first}} {{/-first}} - {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = "{{{value}}}" + {{#enumClassPrefix}}{{{classname.toUpperCase}}}_{{/enumClassPrefix}}{{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore b/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore new file mode 100644 index 00000000000..daf913b1b34 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore new file mode 100644 index 00000000000..7484ee590a3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION new file mode 100644 index 00000000000..c3a2c7076fa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.openapi-generator/VERSION @@ -0,0 +1 @@ +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml b/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml new file mode 100644 index 00000000000..f5cb2ce9a5a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/.travis.yml @@ -0,0 +1,8 @@ +language: go + +install: + - go get -d -v . + +script: + - go build -v ./ + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md new file mode 100644 index 00000000000..f78b00bdb81 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/README.md @@ -0,0 +1,229 @@ +# Go API client for openapi + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + +## Overview +This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. + +- API version: 1.0.0 +- Package version: 1.0.0 +- Build package: org.openapitools.codegen.languages.GoClientExperimentalCodegen + +## Installation + +Install the following dependencies: + +```shell +go get github.com/stretchr/testify/assert +go get golang.org/x/oauth2 +go get golang.org/x/net/context +go get github.com/antihax/optional +``` + +Put the package under your project folder and add the following in import: + +```golang +import sw "./openapi" +``` + +## Documentation for API Endpoints + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AnotherFakeApi* | [**Call123TestSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **Patch** /another-fake/dummy | To test special tags +*DefaultApi* | [**FooGet**](docs/DefaultApi.md#fooget) | **Get** /foo | +*FakeApi* | [**FakeHealthGet**](docs/FakeApi.md#fakehealthget) | **Get** /fake/health | Health check endpoint +*FakeApi* | [**FakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **Post** /fake/outer/boolean | +*FakeApi* | [**FakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **Post** /fake/outer/composite | +*FakeApi* | [**FakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **Post** /fake/outer/number | +*FakeApi* | [**FakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **Post** /fake/outer/string | +*FakeApi* | [**TestBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **Put** /fake/body-with-file-schema | +*FakeApi* | [**TestBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **Put** /fake/body-with-query-params | +*FakeApi* | [**TestClientModel**](docs/FakeApi.md#testclientmodel) | **Patch** /fake | To test \"client\" model +*FakeApi* | [**TestEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +*FakeApi* | [**TestEnumParameters**](docs/FakeApi.md#testenumparameters) | **Get** /fake | To test enum parameters +*FakeApi* | [**TestGroupParameters**](docs/FakeApi.md#testgroupparameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) +*FakeApi* | [**TestInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +*FakeApi* | [**TestJsonFormData**](docs/FakeApi.md#testjsonformdata) | **Get** /fake/jsonFormData | test json serialization of form data +*FakeApi* | [**TestQueryParameterCollectionFormat**](docs/FakeApi.md#testqueryparametercollectionformat) | **Put** /fake/test-query-paramters | +*FakeClassnameTags123Api* | [**TestClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **Patch** /fake_classname_test | To test class name in snake case +*PetApi* | [**AddPet**](docs/PetApi.md#addpet) | **Post** /pet | Add a new pet to the store +*PetApi* | [**DeletePet**](docs/PetApi.md#deletepet) | **Delete** /pet/{petId} | Deletes a pet +*PetApi* | [**FindPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **Get** /pet/findByStatus | Finds Pets by status +*PetApi* | [**FindPetsByTags**](docs/PetApi.md#findpetsbytags) | **Get** /pet/findByTags | Finds Pets by tags +*PetApi* | [**GetPetById**](docs/PetApi.md#getpetbyid) | **Get** /pet/{petId} | Find pet by ID +*PetApi* | [**UpdatePet**](docs/PetApi.md#updatepet) | **Put** /pet | Update an existing pet +*PetApi* | [**UpdatePetWithForm**](docs/PetApi.md#updatepetwithform) | **Post** /pet/{petId} | Updates a pet in the store with form data +*PetApi* | [**UploadFile**](docs/PetApi.md#uploadfile) | **Post** /pet/{petId}/uploadImage | uploads an image +*PetApi* | [**UploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) +*StoreApi* | [**DeleteOrder**](docs/StoreApi.md#deleteorder) | **Delete** /store/order/{order_id} | Delete purchase order by ID +*StoreApi* | [**GetInventory**](docs/StoreApi.md#getinventory) | **Get** /store/inventory | Returns pet inventories by status +*StoreApi* | [**GetOrderById**](docs/StoreApi.md#getorderbyid) | **Get** /store/order/{order_id} | Find purchase order by ID +*StoreApi* | [**PlaceOrder**](docs/StoreApi.md#placeorder) | **Post** /store/order | Place an order for a pet +*UserApi* | [**CreateUser**](docs/UserApi.md#createuser) | **Post** /user | Create user +*UserApi* | [**CreateUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **Post** /user/createWithArray | Creates list of users with given input array +*UserApi* | [**CreateUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **Post** /user/createWithList | Creates list of users with given input array +*UserApi* | [**DeleteUser**](docs/UserApi.md#deleteuser) | **Delete** /user/{username} | Delete user +*UserApi* | [**GetUserByName**](docs/UserApi.md#getuserbyname) | **Get** /user/{username} | Get user by user name +*UserApi* | [**LoginUser**](docs/UserApi.md#loginuser) | **Get** /user/login | Logs user into the system +*UserApi* | [**LogoutUser**](docs/UserApi.md#logoutuser) | **Get** /user/logout | Logs out current logged in user session +*UserApi* | [**UpdateUser**](docs/UserApi.md#updateuser) | **Put** /user/{username} | Updated user + + +## Documentation For Models + + - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) + - [Animal](docs/Animal.md) + - [ApiResponse](docs/ApiResponse.md) + - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) + - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) + - [ArrayTest](docs/ArrayTest.md) + - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) + - [CatAllOf](docs/CatAllOf.md) + - [Category](docs/Category.md) + - [ClassModel](docs/ClassModel.md) + - [Client](docs/Client.md) + - [Dog](docs/Dog.md) + - [DogAllOf](docs/DogAllOf.md) + - [EnumArrays](docs/EnumArrays.md) + - [EnumClass](docs/EnumClass.md) + - [EnumTest](docs/EnumTest.md) + - [File](docs/File.md) + - [FileSchemaTestClass](docs/FileSchemaTestClass.md) + - [Foo](docs/Foo.md) + - [FormatTest](docs/FormatTest.md) + - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [HealthCheckResult](docs/HealthCheckResult.md) + - [InlineObject](docs/InlineObject.md) + - [InlineObject1](docs/InlineObject1.md) + - [InlineObject2](docs/InlineObject2.md) + - [InlineObject3](docs/InlineObject3.md) + - [InlineObject4](docs/InlineObject4.md) + - [InlineObject5](docs/InlineObject5.md) + - [InlineResponseDefault](docs/InlineResponseDefault.md) + - [List](docs/List.md) + - [MapTest](docs/MapTest.md) + - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) + - [Model200Response](docs/Model200Response.md) + - [Name](docs/Name.md) + - [NullableClass](docs/NullableClass.md) + - [NumberOnly](docs/NumberOnly.md) + - [Order](docs/Order.md) + - [OuterComposite](docs/OuterComposite.md) + - [OuterEnum](docs/OuterEnum.md) + - [OuterEnumDefaultValue](docs/OuterEnumDefaultValue.md) + - [OuterEnumInteger](docs/OuterEnumInteger.md) + - [OuterEnumIntegerDefaultValue](docs/OuterEnumIntegerDefaultValue.md) + - [Pet](docs/Pet.md) + - [ReadOnlyFirst](docs/ReadOnlyFirst.md) + - [Return](docs/Return.md) + - [SpecialModelName](docs/SpecialModelName.md) + - [Tag](docs/Tag.md) + - [User](docs/User.md) + + +## Documentation For Authorization + + + +### api_key + +- **Type**: API key +- **API key parameter name**: api_key +- **Location**: HTTP header + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key and passed in as the auth context for each request. + + +### api_key_query + +- **Type**: API key +- **API key parameter name**: api_key_query +- **Location**: URL query string + +Note, each API key must be added to a map of `map[string]APIKey` where the key is: api_key_query and passed in as the auth context for each request. + + +### bearer_test + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + + +### http_basic_test + +- **Type**: HTTP basic authentication + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{ + UserName: "username", + Password: "password", +}) +r, err := client.Service.Operation(auth, args) +``` + + +### petstore_auth + + +- **Type**: OAuth +- **Flow**: implicit +- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog +- **Scopes**: + - **write:pets**: modify pets in your account + - **read:pets**: read your pets + +Example + +```golang +auth := context.WithValue(context.Background(), sw.ContextAccessToken, "ACCESSTOKENSTRING") +r, err := client.Service.Operation(auth, args) +``` + +Or via OAuth2 module to automatically refresh tokens and perform user authentication. + +```golang +import "golang.org/x/oauth2" + +/* Perform OAuth2 round trip request and obtain a token */ + +tokenSource := oauth2cfg.TokenSource(createContext(httpClient), &token) +auth := context.WithValue(oauth2.NoContext, sw.ContextOAuth2, tokenSource) +r, err := client.Service.Operation(auth, args) +``` + + +## Documentation for Utility Methods + +Due to the fact that model structure members are all pointers, this package contains +a number of utility functions to easily obtain pointers to values of basic types. +Each of these functions takes a value of the given basic type and returns a pointer to it: + +* `PtrBool` +* `PtrInt` +* `PtrInt32` +* `PtrInt64` +* `PtrFloat` +* `PtrFloat32` +* `PtrFloat64` +* `PtrString` +* `PtrTime` + +## Author + + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml new file mode 100644 index 00000000000..c5e930efc56 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api/openapi.yaml @@ -0,0 +1,2059 @@ +openapi: 3.0.0 +info: + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special characters: + " \' + license: + name: Apache-2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + title: OpenAPI Petstore + version: 1.0.0 +servers: +- description: petstore server + url: http://{server}.swagger.io:{port}/v2 + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: https://localhost:8080/{version} + variables: + version: + default: v2 + enum: + - v1 + - v2 +tags: +- description: Everything about your Pets + name: pet +- description: Access to Petstore orders + name: store +- description: Operations about user + name: user +paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_default' + description: response + /pet: + post: + operationId: addPet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 405: + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Add a new pet to the store + tags: + - pet + put: + operationId: updatePet + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 400: + description: Invalid ID supplied + 404: + description: Pet not found + 405: + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + summary: Update an existing pet + tags: + - pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + /pet/findByStatus: + get: + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - description: Status values that need to be considered for filter + explode: false + in: query + name: status + required: true + schema: + items: + default: available + enum: + - available + - pending + - sold + type: string + type: array + style: form + responses: + 200: + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + 400: + description: Invalid status value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by status + tags: + - pet + /pet/findByTags: + get: + deprecated: true + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - description: Tags to filter by + explode: false + in: query + name: tags + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + content: + application/xml: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + application/json: + schema: + items: + $ref: '#/components/schemas/Pet' + type: array + description: successful operation + 400: + description: Invalid tag value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Finds Pets by tags + tags: + - pet + /pet/{petId}: + delete: + operationId: deletePet + parameters: + - explode: false + in: header + name: api_key + required: false + schema: + type: string + style: simple + - description: Pet id to delete + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + 400: + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + summary: Deletes a pet + tags: + - pet + get: + description: Returns a single pet + operationId: getPetById + parameters: + - description: ID of pet to return + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation + 400: + description: Invalid ID supplied + 404: + description: Pet not found + security: + - api_key: [] + summary: Find pet by ID + tags: + - pet + post: + operationId: updatePetWithForm + parameters: + - description: ID of pet that needs to be updated + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object' + content: + application/x-www-form-urlencoded: + schema: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + responses: + 405: + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + summary: Updates a pet in the store with form data + tags: + - pet + /pet/{petId}/uploadImage: + post: + operationId: uploadFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_1' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image + tags: + - pet + /store/inventory: + get: + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + 200: + content: + application/json: + schema: + additionalProperties: + format: int32 + type: integer + type: object + description: successful operation + security: + - api_key: [] + summary: Returns pet inventories by status + tags: + - store + /store/order: + post: + operationId: placeOrder + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + description: Invalid Order + summary: Place an order for a pet + tags: + - store + /store/order/{order_id}: + delete: + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - description: ID of the order that needs to be deleted + explode: false + in: path + name: order_id + required: true + schema: + type: string + style: simple + responses: + 400: + description: Invalid ID supplied + 404: + description: Order not found + summary: Delete purchase order by ID + tags: + - store + get: + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions + operationId: getOrderById + parameters: + - description: ID of pet that needs to be fetched + explode: false + in: path + name: order_id + required: true + schema: + format: int64 + maximum: 5 + minimum: 1 + type: integer + style: simple + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + description: successful operation + 400: + description: Invalid ID supplied + 404: + description: Order not found + summary: Find purchase order by ID + tags: + - store + /user: + post: + description: This can only be done by the logged in user. + operationId: createUser + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + responses: + default: + description: successful operation + summary: Create user + tags: + - user + /user/createWithArray: + post: + operationId: createUsersWithArrayInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/createWithList: + post: + operationId: createUsersWithListInput + requestBody: + $ref: '#/components/requestBodies/UserArray' + responses: + default: + description: successful operation + summary: Creates list of users with given input array + tags: + - user + /user/login: + get: + operationId: loginUser + parameters: + - description: The user name for login + explode: true + in: query + name: username + required: true + schema: + type: string + style: form + - description: The password for login in clear text + explode: true + in: query + name: password + required: true + schema: + type: string + style: form + responses: + 200: + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + explode: false + schema: + format: int32 + type: integer + style: simple + X-Expires-After: + description: date in UTC when token expires + explode: false + schema: + format: date-time + type: string + style: simple + 400: + description: Invalid username/password supplied + summary: Logs user into the system + tags: + - user + /user/logout: + get: + operationId: logoutUser + responses: + default: + description: successful operation + summary: Logs out current logged in user session + tags: + - user + /user/{username}: + delete: + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - description: The name that needs to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + 400: + description: Invalid username supplied + 404: + description: User not found + summary: Delete user + tags: + - user + get: + operationId: getUserByName + parameters: + - description: The name that needs to be fetched. Use user1 for testing. + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + responses: + 200: + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + description: successful operation + 400: + description: Invalid username supplied + 404: + description: User not found + summary: Get user by user name + tags: + - user + put: + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - description: name that need to be deleted + explode: false + in: path + name: username + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + responses: + 400: + description: Invalid user supplied + 404: + description: User not found + summary: Updated user + tags: + - user + /fake_classname_test: + patch: + description: To test class name in snake case + operationId: testClassname + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + security: + - api_key_query: [] + summary: To test class name in snake case + tags: + - fake_classname_tags 123#$%^ + /fake: + delete: + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + parameters: + - description: Required String in group parameters + explode: true + in: query + name: required_string_group + required: true + schema: + type: integer + style: form + - description: Required Boolean in group parameters + explode: false + in: header + name: required_boolean_group + required: true + schema: + type: boolean + style: simple + - description: Required Integer in group parameters + explode: true + in: query + name: required_int64_group + required: true + schema: + format: int64 + type: integer + style: form + - description: String in group parameters + explode: true + in: query + name: string_group + required: false + schema: + type: integer + style: form + - description: Boolean in group parameters + explode: false + in: header + name: boolean_group + required: false + schema: + type: boolean + style: simple + - description: Integer in group parameters + explode: true + in: query + name: int64_group + required: false + schema: + format: int64 + type: integer + style: form + responses: + 400: + description: Someting wrong + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + tags: + - fake + x-group-parameters: true + get: + description: To test enum parameters + operationId: testEnumParameters + parameters: + - description: Header parameter enum test (string array) + explode: false + in: header + name: enum_header_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: simple + - description: Header parameter enum test (string) + explode: false + in: header + name: enum_header_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: simple + - description: Query parameter enum test (string array) + explode: true + in: query + name: enum_query_string_array + required: false + schema: + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + style: form + - description: Query parameter enum test (string) + explode: true + in: query + name: enum_query_string + required: false + schema: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_integer + required: false + schema: + enum: + - 1 + - -2 + format: int32 + type: integer + style: form + - description: Query parameter enum test (double) + explode: true + in: query + name: enum_query_double + required: false + schema: + enum: + - 1.1 + - -1.2 + format: double + type: number + style: form + requestBody: + $ref: '#/components/requestBodies/inline_object_2' + content: + application/x-www-form-urlencoded: + schema: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + responses: + 400: + description: Invalid request + 404: + description: Not found + summary: To test enum parameters + tags: + - fake + patch: + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test "client" model + tags: + - fake + post: + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + requestBody: + $ref: '#/components/requestBodies/inline_object_3' + content: + application/x-www-form-urlencoded: + schema: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + responses: + 400: + description: Invalid username supplied + 404: + description: User not found + security: + - http_basic_test: [] + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + tags: + - fake + /fake/outer/number: + post: + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + description: Output number + tags: + - fake + /fake/outer/string: + post: + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + description: Output string + tags: + - fake + /fake/outer/boolean: + post: + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Output boolean + tags: + - fake + /fake/outer/composite: + post: + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + responses: + 200: + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + description: Output composite + tags: + - fake + /fake/jsonFormData: + get: + operationId: testJsonFormData + requestBody: + $ref: '#/components/requestBodies/inline_object_4' + content: + application/x-www-form-urlencoded: + schema: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + responses: + 200: + description: successful operation + summary: test json serialization of form data + tags: + - fake + /fake/inline-additionalProperties: + post: + operationId: testInlineAdditionalProperties + requestBody: + content: + application/json: + schema: + additionalProperties: + type: string + type: object + description: request body + required: true + responses: + 200: + description: successful operation + summary: test inline additionalProperties + tags: + - fake + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams + parameters: + - explode: true + in: query + name: query + required: true + schema: + type: string + style: form + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + responses: + 200: + description: Success + tags: + - fake + /another-fake/dummy: + patch: + description: To test special tags and operation ID starting with number + operationId: 123_test_@#$%_special_tags + requestBody: + $ref: '#/components/requestBodies/Client' + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: successful operation + summary: To test special tags + tags: + - $another-fake? + /fake/body-with-file-schema: + put: + description: For this test, the body for this request much reference a schema + named `File`. + operationId: testBodyWithFileSchema + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + responses: + 200: + description: Success + tags: + - fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + description: Success + tags: + - fake + /fake/{petId}/uploadImageWithRequiredFile: + post: + operationId: uploadFileWithRequiredFile + parameters: + - description: ID of pet to update + explode: false + in: path + name: petId + required: true + schema: + format: int64 + type: integer + style: simple + requestBody: + $ref: '#/components/requestBodies/inline_object_5' + content: + multipart/form-data: + schema: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + description: successful operation + security: + - petstore_auth: + - write:pets + - read:pets + summary: uploads an image (required) + tags: + - pet + /fake/health: + get: + responses: + 200: + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake +components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' + inline_object_2: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_2' + inline_object_3: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_3' + inline_object_4: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object_4' + inline_object_5: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_5' + schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string + Order: + example: + petId: 6 + quantity: 1 + id: 0 + shipDate: 2000-01-23T04:56:07.000+00:00 + complete: false + status: placed + properties: + id: + format: int64 + type: integer + petId: + format: int64 + type: integer + quantity: + format: int32 + type: integer + shipDate: + format: date-time + type: string + status: + description: Order Status + enum: + - placed + - approved + - delivered + type: string + complete: + default: false + type: boolean + type: object + xml: + name: Order + Category: + example: + name: default-name + id: 6 + properties: + id: + format: int64 + type: integer + name: + default: default-name + type: string + required: + - name + type: object + xml: + name: Category + User: + example: + firstName: firstName + lastName: lastName + password: password + userStatus: 6 + phone: phone + id: 0 + email: email + username: username + properties: + id: + format: int64 + type: integer + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + description: User Status + format: int32 + type: integer + type: object + xml: + name: User + Tag: + example: + name: name + id: 1 + properties: + id: + format: int64 + type: integer + name: + type: string + type: object + xml: + name: Tag + Pet: + example: + photoUrls: + - photoUrls + - photoUrls + name: doggie + id: 0 + category: + name: default-name + id: 6 + tags: + - name: name + id: 1 + - name: name + id: 1 + status: available + properties: + id: + format: int64 + type: integer + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + example: doggie + type: string + photoUrls: + items: + type: string + type: array + xml: + name: photoUrl + wrapped: true + tags: + items: + $ref: '#/components/schemas/Tag' + type: array + xml: + name: tag + wrapped: true + status: + description: pet status in the store + enum: + - available + - pending + - sold + type: string + required: + - name + - photoUrls + type: object + xml: + name: Pet + ApiResponse: + example: + code: 0 + type: type + message: message + properties: + code: + format: int32 + type: integer + type: + type: string + message: + type: string + type: object + Return: + description: Model for testing reserved words + properties: + return: + format: int32 + type: integer + xml: + name: Return + Name: + description: Model for testing model name same as property name + properties: + name: + format: int32 + type: integer + snake_case: + format: int32 + readOnly: true + type: integer + property: + type: string + 123Number: + readOnly: true + type: integer + required: + - name + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + format: int32 + type: integer + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Dog_allOf' + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Cat_allOf' + Animal: + discriminator: + propertyName: className + properties: + className: + type: string + color: + default: red + type: string + required: + - className + type: object + AnimalFarm: + items: + $ref: '#/components/schemas/Animal' + type: array + format_test: + properties: + integer: + maximum: 100 + minimum: 10 + type: integer + int32: + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + format: int64 + type: integer + number: + maximum: 543.2 + minimum: 32.1 + type: number + float: + format: float + maximum: 987.6 + minimum: 54.3 + type: number + double: + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + pattern: /[a-z]/i + type: string + byte: + format: byte + type: string + binary: + format: binary + type: string + date: + format: date + type: string + dateTime: + format: date-time + type: string + uuid: + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + format: uuid + type: string + password: + format: password + maxLength: 64 + minLength: 10 + type: string + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: ^\d{10}$ + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: /^image_\d{1,3}$/i + type: string + required: + - byte + - date + - number + - password + type: object + EnumClass: + default: -efg + enum: + - _abc + - -efg + - (xyz) + type: string + Enum_Test: + properties: + enum_string: + enum: + - UPPER + - lower + - "" + type: string + enum_string_required: + enum: + - UPPER + - lower + - "" + type: string + enum_integer: + enum: + - 1 + - -1 + format: int32 + type: integer + enum_number: + enum: + - 1.1 + - -1.2 + format: double + type: number + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + required: + - enum_string_required + type: object + AdditionalPropertiesClass: + properties: + map_property: + additionalProperties: + type: string + type: object + map_of_map_property: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + type: object + MixedPropertiesAndAdditionalPropertiesClass: + properties: + uuid: + format: uuid + type: string + dateTime: + format: date-time + type: string + map: + additionalProperties: + $ref: '#/components/schemas/Animal' + type: object + type: object + List: + properties: + 123-list: + type: string + type: object + Client: + example: + client: client + properties: + client: + type: string + type: object + ReadOnlyFirst: + properties: + bar: + readOnly: true + type: string + baz: + type: string + type: object + hasOnlyReadOnly: + properties: + bar: + readOnly: true + type: string + foo: + readOnly: true + type: string + type: object + Capitalization: + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + type: object + MapTest: + properties: + map_map_of_string: + additionalProperties: + additionalProperties: + type: string + type: object + type: object + map_of_enum_string: + additionalProperties: + enum: + - UPPER + - lower + type: string + type: object + direct_map: + additionalProperties: + type: boolean + type: object + indirect_map: + additionalProperties: + type: boolean + type: object + type: object + ArrayTest: + properties: + array_of_string: + items: + type: string + type: array + array_array_of_integer: + items: + items: + format: int64 + type: integer + type: array + type: array + array_array_of_model: + items: + items: + $ref: '#/components/schemas/ReadOnlyFirst' + type: array + type: array + type: object + NumberOnly: + properties: + JustNumber: + type: number + type: object + ArrayOfNumberOnly: + properties: + ArrayNumber: + items: + type: number + type: array + type: object + ArrayOfArrayOfNumberOnly: + properties: + ArrayArrayNumber: + items: + items: + type: number + type: array + type: array + type: object + EnumArrays: + properties: + just_symbol: + enum: + - '>=' + - $ + type: string + array_enum: + items: + enum: + - fish + - crab + type: string + type: array + type: object + OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + type: integer + OuterEnumDefaultValue: + default: placed + enum: + - placed + - approved + - delivered + type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer + OuterComposite: + example: + my_string: my_string + my_number: 0.8008281904610115 + my_boolean: true + properties: + my_number: + type: number + my_string: + type: string + my_boolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + type: object + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + type: object + FileSchemaTestClass: + example: + file: + sourceURI: sourceURI + files: + - sourceURI: sourceURI + - sourceURI: sourceURI + properties: + file: + $ref: '#/components/schemas/File' + files: + items: + $ref: '#/components/schemas/File' + type: array + type: object + File: + description: Must be named `File` for test. + example: + sourceURI: sourceURI + properties: + sourceURI: + description: Test capitalization + type: string + type: object + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: $special[model.name] + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage + properties: + NullableMessage: + nullable: true + type: string + type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + inline_response_default: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object + inline_object_2: + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + items: + default: $ + enum: + - '>' + - $ + type: string + type: array + enum_form_string: + default: -efg + description: Form parameter enum test (string) + enum: + - _abc + - -efg + - (xyz) + type: string + type: object + inline_object_3: + properties: + integer: + description: None + maximum: 100 + minimum: 10 + type: integer + int32: + description: None + format: int32 + maximum: 200 + minimum: 20 + type: integer + int64: + description: None + format: int64 + type: integer + number: + description: None + maximum: 543.2 + minimum: 32.1 + type: number + float: + description: None + format: float + maximum: 987.6 + type: number + double: + description: None + format: double + maximum: 123.4 + minimum: 67.8 + type: number + string: + description: None + pattern: /[a-z]/i + type: string + pattern_without_delimiter: + description: None + pattern: ^[A-Z].* + type: string + byte: + description: None + format: byte + type: string + binary: + description: None + format: binary + type: string + date: + description: None + format: date + type: string + dateTime: + description: None + format: date-time + type: string + password: + description: None + format: password + maxLength: 64 + minLength: 10 + type: string + callback: + description: None + type: string + required: + - byte + - double + - number + - pattern_without_delimiter + type: object + inline_object_4: + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + type: object + inline_object_5: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + format: binary + type: string + required: + - requiredFile + type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean + securitySchemes: + petstore_auth: + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + type: oauth2 + api_key: + in: header + name: api_key + type: apiKey + api_key_query: + in: query + name: api_key_query + type: apiKey + http_basic_test: + scheme: basic + type: http + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go new file mode 100644 index 00000000000..0ec159f0ea9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_another_fake.go @@ -0,0 +1,114 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// AnotherFakeApiService AnotherFakeApi service +type AnotherFakeApiService service + +/* +Call123TestSpecialTags To test special tags +To test special tags and operation ID starting with number + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param client client model +@return Client +*/ +func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/another-fake/dummy" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &client + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + 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 + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go new file mode 100644 index 00000000000..b5f16d1020b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_default.go @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// DefaultApiService DefaultApi service +type DefaultApiService service + +/* +FooGet Method for FooGet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return InlineResponseDefault +*/ +func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponseDefault + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/foo" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 0 { + var v InlineResponseDefault + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go new file mode 100644 index 00000000000..7e7c0f3a54f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake.go @@ -0,0 +1,1322 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "github.com/antihax/optional" + "os" + "reflect" +) + +// Linger please +var ( + _ _context.Context +) + +// FakeApiService FakeApi service +type FakeApiService service + +/* +FakeHealthGet Health check endpoint + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return HealthCheckResult +*/ +func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue HealthCheckResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/health" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v HealthCheckResult + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterBooleanSerializeOpts Optional parameters for the method 'FakeOuterBooleanSerialize' +type FakeOuterBooleanSerializeOpts struct { + Body optional.Bool +} + +/* +FakeOuterBooleanSerialize Method for FakeOuterBooleanSerialize +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.Bool) - Input boolean as post body +@return bool +*/ +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue bool + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/boolean" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarPostBody = localVarOptionals.Body.Value() + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterCompositeSerializeOpts Optional parameters for the method 'FakeOuterCompositeSerialize' +type FakeOuterCompositeSerializeOpts struct { + OuterComposite optional.Interface +} + +/* +FakeOuterCompositeSerialize Method for FakeOuterCompositeSerialize +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 "OuterComposite" (optional.Interface of OuterComposite) - Input composite as post body +@return OuterComposite +*/ +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue OuterComposite + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/composite" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.OuterComposite.IsSet() { + localVarOptionalOuterComposite, localVarOptionalOuterCompositeok := localVarOptionals.OuterComposite.Value().(OuterComposite) + if !localVarOptionalOuterCompositeok { + return localVarReturnValue, nil, reportError("outerComposite should be OuterComposite") + } + localVarPostBody = &localVarOptionalOuterComposite + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + 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 + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterNumberSerializeOpts Optional parameters for the method 'FakeOuterNumberSerialize' +type FakeOuterNumberSerializeOpts struct { + Body optional.Float32 +} + +/* +FakeOuterNumberSerialize Method for FakeOuterNumberSerialize +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.Float32) - Input number as post body +@return float32 +*/ +func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue float32 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/number" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarPostBody = localVarOptionals.Body.Value() + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// FakeOuterStringSerializeOpts Optional parameters for the method 'FakeOuterStringSerialize' +type FakeOuterStringSerializeOpts struct { + Body optional.String +} + +/* +FakeOuterStringSerialize Method for FakeOuterStringSerialize +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.String) - Input string as post body +@return string +*/ +func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/outer/string" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"*/*"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + localVarPostBody = localVarOptionals.Body.Value() + } + + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +TestBodyWithFileSchema Method for TestBodyWithFileSchema +For this test, the body for this request much reference a schema named `File`. + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param fileSchemaTestClass +*/ +func (a *FakeApiService) TestBodyWithFileSchema(ctx _context.Context, fileSchemaTestClass FileSchemaTestClass) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/body-with-file-schema" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &fileSchemaTestClass + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestBodyWithQueryParams Method for TestBodyWithQueryParams + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param query + * @param user +*/ +func (a *FakeApiService) TestBodyWithQueryParams(ctx _context.Context, query string, user User) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/body-with-query-params" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("query", parameterToString(query, "")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestClientModel 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 client client model +@return Client +*/ +func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &client + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + 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 + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// TestEndpointParametersOpts Optional parameters for the method 'TestEndpointParameters' +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 +} + +/* +TestEndpointParameters 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 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.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 +*/ +func (a *FakeApiService) TestEndpointParameters(ctx _context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if number < 32.1 { + return nil, reportError("number must be greater than 32.1") + } + if number > 543.2 { + return nil, reportError("number must be less than 543.2") + } + if double < 67.8 { + return nil, reportError("double must be greater than 67.8") + } + if double > 123.4 { + return nil, reportError("double must be less than 123.4") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + 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.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(), "")) + } + 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 + 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(), "")) + } + if localVarOptionals != nil && localVarOptionals.DateTime.IsSet() { + localVarFormParams.Add("dateTime", parameterToString(localVarOptionals.DateTime.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Password.IsSet() { + localVarFormParams.Add("password", parameterToString(localVarOptionals.Password.Value(), "")) + } + 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// TestEnumParametersOpts Optional parameters for the method 'TestEnumParameters' +type TestEnumParametersOpts struct { + EnumHeaderStringArray optional.Interface + EnumHeaderString optional.String + EnumQueryStringArray optional.Interface + EnumQueryString optional.String + EnumQueryInteger optional.Int32 + EnumQueryDouble optional.Float64 + EnumFormStringArray optional.Interface + EnumFormString optional.String +} + +/* +TestEnumParameters 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 "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) +*/ +func (a *FakeApiService) TestEnumParameters(ctx _context.Context, localVarOptionals *TestEnumParametersOpts) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + if localVarOptionals != nil && localVarOptionals.EnumQueryStringArray.IsSet() { + t:=localVarOptionals.EnumQueryStringArray.Value() + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("enum_query_string_array", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("enum_query_string_array", parameterToString(t, "multi")) + } + } + if localVarOptionals != nil && localVarOptionals.EnumQueryString.IsSet() { + localVarQueryParams.Add("enum_query_string", parameterToString(localVarOptionals.EnumQueryString.Value(), "")) + } + 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{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.EnumHeaderStringArray.IsSet() { + localVarHeaderParams["enum_header_string_array"] = parameterToString(localVarOptionals.EnumHeaderStringArray.Value(), "csv") + } + if localVarOptionals != nil && localVarOptionals.EnumHeaderString.IsSet() { + 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")) + } + 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// TestGroupParametersOpts Optional parameters for the method 'TestGroupParameters' +type TestGroupParametersOpts struct { + StringGroup optional.Int32 + BooleanGroup optional.Bool + Int64Group optional.Int64 +} + +/* +TestGroupParameters Fake endpoint to test group parameters (optional) +Fake endpoint to test group parameters (optional) + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param requiredStringGroup Required String in group parameters + * @param requiredBooleanGroup Required Boolean in group parameters + * @param requiredInt64Group Required Integer in group parameters + * @param optional nil or *TestGroupParametersOpts - Optional Parameters: + * @param "StringGroup" (optional.Int32) - String in group parameters + * @param "BooleanGroup" (optional.Bool) - Boolean in group parameters + * @param "Int64Group" (optional.Int64) - Integer in group parameters +*/ +func (a *FakeApiService) TestGroupParameters(ctx _context.Context, requiredStringGroup int32, requiredBooleanGroup bool, requiredInt64Group int64, localVarOptionals *TestGroupParametersOpts) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("required_string_group", parameterToString(requiredStringGroup, "")) + localVarQueryParams.Add("required_int64_group", parameterToString(requiredInt64Group, "")) + if localVarOptionals != nil && localVarOptionals.StringGroup.IsSet() { + localVarQueryParams.Add("string_group", parameterToString(localVarOptionals.StringGroup.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Int64Group.IsSet() { + localVarQueryParams.Add("int64_group", parameterToString(localVarOptionals.Int64Group.Value(), "")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarHeaderParams["required_boolean_group"] = parameterToString(requiredBooleanGroup, "") + if localVarOptionals != nil && localVarOptionals.BooleanGroup.IsSet() { + localVarHeaderParams["boolean_group"] = parameterToString(localVarOptionals.BooleanGroup.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestInlineAdditionalProperties test inline additionalProperties + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param requestBody request body +*/ +func (a *FakeApiService) TestInlineAdditionalProperties(ctx _context.Context, requestBody map[string]string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/inline-additionalProperties" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &requestBody + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestJsonFormData 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) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/jsonFormData" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + localVarFormParams.Add("param", parameterToString(param, "")) + localVarFormParams.Add("param2", parameterToString(param2, "")) + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +TestQueryParameterCollectionFormat Method for TestQueryParameterCollectionFormat +To test the collection format in query parameters + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pipe + * @param ioutil + * @param http + * @param url + * @param context +*/ +func (a *FakeApiService) TestQueryParameterCollectionFormat(ctx _context.Context, pipe []string, ioutil []string, http []string, url []string, context []string) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/test-query-paramters" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + t:=pipe + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("pipe", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("pipe", parameterToString(t, "multi")) + } + localVarQueryParams.Add("ioutil", parameterToString(ioutil, "csv")) + localVarQueryParams.Add("http", parameterToString(http, "space")) + localVarQueryParams.Add("url", parameterToString(url, "csv")) + t:=context + if reflect.TypeOf(t).Kind() == reflect.Slice { + s := reflect.ValueOf(t) + for i := 0; i < s.Len(); i++ { + localVarQueryParams.Add("context", parameterToString(s.Index(i), "multi")) + } + } else { + localVarQueryParams.Add("context", parameterToString(t, "multi")) + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go new file mode 100644 index 00000000000..6d5f3c3bc2c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_fake_classname_tags123.go @@ -0,0 +1,128 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" +) + +// Linger please +var ( + _ _context.Context +) + +// FakeClassnameTags123ApiService FakeClassnameTags123Api service +type FakeClassnameTags123ApiService service + +/* +TestClassname 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 client client model +@return Client +*/ +func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, client Client) (Client, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPatch + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Client + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake_classname_test" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &client + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := auth["api_key_query"]; ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarQueryParams.Add("api_key_query", key) + } + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + 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 + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go new file mode 100644 index 00000000000..16f7ff7ae6a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_pet.go @@ -0,0 +1,818 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "fmt" + "strings" + "github.com/antihax/optional" + "os" +) + +// Linger please +var ( + _ _context.Context +) + +// PetApiService PetApi service +type PetApiService service + +/* +AddPet 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 pet Pet object that needs to be added to the store +*/ +func (a *PetApiService) AddPet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &pet + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// DeletePetOpts Optional parameters for the method 'DeletePet' +type DeletePetOpts struct { + ApiKey optional.String +} + +/* +DeletePet 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) - +*/ +func (a *PetApiService) DeletePet(ctx _context.Context, petId int64, localVarOptionals *DeletePetOpts) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +FindPetsByStatus 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Pet + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/findByStatus" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("status", parameterToString(status, "csv")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v []Pet + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +FindPetsByTags 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Pet + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/findByTags" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("tags", parameterToString(tags, "csv")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v []Pet + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +GetPetById 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Pet + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := auth["api_key"]; ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["api_key"] = key + } + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v Pet + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +UpdatePet Update an existing pet + * @param ctx _context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param pet Pet object that needs to be added to the store +*/ +func (a *PetApiService) UpdatePet(ctx _context.Context, pet Pet) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/xml"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &pet + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UpdatePetWithFormOpts Optional parameters for the method 'UpdatePetWithForm' +type UpdatePetWithFormOpts struct { + Name optional.String + Status optional.String +} + +/* +UpdatePetWithForm 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 +*/ +func (a *PetApiService) UpdatePetWithForm(ctx _context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/x-www-form-urlencoded"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Name.IsSet() { + localVarFormParams.Add("name", parameterToString(localVarOptionals.Name.Value(), "")) + } + 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +// UploadFileOpts Optional parameters for the method 'UploadFile' +type UploadFileOpts struct { + AdditionalMetadata optional.String + File optional.Interface +} + +/* +UploadFile 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 +@return ApiResponse +*/ +func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/pet/{petId}/uploadImage" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + 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 + localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) + if !localVarFileOk { + return localVarReturnValue, nil, reportError("file should be *os.File") + } + } + 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v ApiResponse + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +// UploadFileWithRequiredFileOpts Optional parameters for the method 'UploadFileWithRequiredFile' +type UploadFileWithRequiredFileOpts struct { + AdditionalMetadata optional.String +} + +/* +UploadFileWithRequiredFile 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 requiredFile file to upload + * @param optional nil or *UploadFileWithRequiredFileOpts - Optional Parameters: + * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server +@return ApiResponse +*/ +func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ApiResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake/{petId}/uploadImageWithRequiredFile" + localVarPath = strings.Replace(localVarPath, "{"+"petId"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", petId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { + localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) + } + 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, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v ApiResponse + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go new file mode 100644 index 00000000000..5c23d72825d --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_store.go @@ -0,0 +1,376 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "fmt" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// StoreApiService StoreApi service +type StoreApiService service + +/* +DeleteOrder 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) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +GetInventory 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue map[string]int32 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/inventory" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKeys).(map[string]APIKey); ok { + if auth, ok := auth["api_key"]; ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["api_key"] = key + } + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + 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")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +GetOrderById 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Order + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/order/{order_id}" + localVarPath = strings.Replace(localVarPath, "{"+"order_id"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", orderId)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + if orderId < 1 { + return localVarReturnValue, nil, reportError("orderId must be greater than 1") + } + if orderId > 5 { + return localVarReturnValue, nil, reportError("orderId must be less than 5") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v Order + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +PlaceOrder 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 order order placed for purchasing the pet +@return Order +*/ +func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Order + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/store/order" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &order + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v Order + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go new file mode 100644 index 00000000000..852bf6da2e1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/api_user.go @@ -0,0 +1,606 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + _context "context" + _ioutil "io/ioutil" + _nethttp "net/http" + _neturl "net/url" + "fmt" + "strings" +) + +// Linger please +var ( + _ _context.Context +) + +// UserApiService UserApi service +type UserApiService service + +/* +CreateUser 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 user Created user object +*/ +func (a *UserApiService) CreateUser(ctx _context.Context, user User) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +CreateUsersWithArrayInput 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 user List of user object +*/ +func (a *UserApiService) CreateUsersWithArrayInput(ctx _context.Context, user []User) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/createWithArray" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +CreateUsersWithListInput 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 user List of user object +*/ +func (a *UserApiService) CreateUsersWithListInput(ctx _context.Context, user []User) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPost + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/createWithList" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +DeleteUser 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) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodDelete + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +GetUserByName 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue User + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + var v User + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +LoginUser 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, *_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/login" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + localVarQueryParams.Add("username", parameterToString(username, "")) + localVarQueryParams.Add("password", parameterToString(password, "")) + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/xml", "application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 200 { + 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 + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + +/* +LogoutUser 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) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodGet + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/logout" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} + +/* +UpdateUser 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 user Updated user object +*/ +func (a *UserApiService) UpdateUser(ctx _context.Context, username string, user User) (*_nethttp.Response, error) { + var ( + localVarHTTPMethod = _nethttp.MethodPut + localVarPostBody interface{} + localVarFormFileName string + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/user/{username}" + localVarPath = strings.Replace(localVarPath, "{"+"username"+"}", _neturl.QueryEscape(fmt.Sprintf("%v", username)), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := _neturl.Values{} + localVarFormParams := _neturl.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = &user + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(r) + if err != nil || localVarHTTPResponse == nil { + return localVarHTTPResponse, err + } + + localVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + if err != nil { + return localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + return localVarHTTPResponse, newErr + } + + return localVarHTTPResponse, nil +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go new file mode 100644 index 00000000000..db6225efebc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/client.go @@ -0,0 +1,517 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) + xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) +) + +// APIClient manages communication with the OpenAPI Petstore API v1.0.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + AnotherFakeApi *AnotherFakeApiService + + DefaultApi *DefaultApiService + + FakeApi *FakeApiService + + FakeClassnameTags123Api *FakeClassnameTags123ApiService + + PetApi *PetApiService + + StoreApi *StoreApiService + + UserApi *UserApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.AnotherFakeApi = (*AnotherFakeApiService)(&c.common) + c.DefaultApi = (*DefaultApiService)(&c.common) + c.FakeApi = (*FakeApiService)(&c.common) + c.FakeClassnameTags123Api = (*FakeClassnameTags123ApiService)(&c.common) + c.PetApi = (*PetApiService)(&c.common) + c.StoreApi = (*StoreApiService)(&c.common) + c.UserApi = (*UserApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } else if t, ok := obj.(time.Time); ok { + return t.Format(time.RFC3339) + } + + return fmt.Sprintf("%v", obj) +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// ChangeBasePath changes base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFileName string, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile(formFileName, filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if xmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if jsonCheck.MatchString(contentType) { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + err = xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericOpenAPIError Provides access to the body, error and model on returned errors. +type GenericOpenAPIError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericOpenAPIError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericOpenAPIError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericOpenAPIError) Model() interface{} { + return e.model +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go new file mode 100644 index 00000000000..1c71df13090 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/configuration.go @@ -0,0 +1,75 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes an oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKeys takes a string apikey as authentication for the request + ContextAPIKeys = contextKey("apiKeys") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +// Configuration stores the configuration of the API client +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "http://petstore.swagger.io:80/v2", + DefaultHeader: make(map[string]string), + UserAgent: "OpenAPI-Generator/1.0.0/go", + } + return cfg +} + +// AddDefaultHeader adds a new HTTP header to the default header in the request +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md new file mode 100644 index 00000000000..264d926fced --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AdditionalPropertiesClass.md @@ -0,0 +1,65 @@ +# AdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapProperty** | Pointer to **map[string]string** | | [optional] +**MapOfMapProperty** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] + +## Methods + +### GetMapProperty + +`func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string` + +GetMapProperty returns the MapProperty field if non-nil, zero value otherwise. + +### GetMapPropertyOk + +`func (o *AdditionalPropertiesClass) GetMapPropertyOk() (map[string]string, bool)` + +GetMapPropertyOk returns a tuple with the MapProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapProperty + +`func (o *AdditionalPropertiesClass) HasMapProperty() bool` + +HasMapProperty returns a boolean if a field has been set. + +### SetMapProperty + +`func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string)` + +SetMapProperty gets a reference to the given map[string]string and assigns it to the MapProperty field. + +### GetMapOfMapProperty + +`func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string` + +GetMapOfMapProperty returns the MapOfMapProperty field if non-nil, zero value otherwise. + +### GetMapOfMapPropertyOk + +`func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (map[string]map[string]string, bool)` + +GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapOfMapProperty + +`func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool` + +HasMapOfMapProperty returns a boolean if a field has been set. + +### SetMapOfMapProperty + +`func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string)` + +SetMapOfMapProperty gets a reference to the given map[string]map[string]string and assigns it to the MapOfMapProperty field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md new file mode 100644 index 00000000000..55133b29745 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Animal.md @@ -0,0 +1,65 @@ +# Animal + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] + +## Methods + +### GetClassName + +`func (o *Animal) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Animal) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *Animal) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *Animal) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *Animal) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Animal) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *Animal) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *Animal) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md new file mode 100644 index 00000000000..9c6ce64e293 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/AnotherFakeApi.md @@ -0,0 +1,42 @@ +# \AnotherFakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Call123TestSpecialTags**](AnotherFakeApi.md#Call123TestSpecialTags) | **Patch** /another-fake/dummy | To test special tags + + + +## Call123TestSpecialTags + +> Client Call123TestSpecialTags(ctx, client) +To test special tags + +To test special tags and operation ID starting with number + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[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) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md new file mode 100644 index 00000000000..b0c891bbc96 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ApiResponse.md @@ -0,0 +1,91 @@ +# ApiResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | Pointer to **int32** | | [optional] +**Type** | Pointer to **string** | | [optional] +**Message** | Pointer to **string** | | [optional] + +## Methods + +### GetCode + +`func (o *ApiResponse) GetCode() int32` + +GetCode returns the Code field if non-nil, zero value otherwise. + +### GetCodeOk + +`func (o *ApiResponse) GetCodeOk() (int32, bool)` + +GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCode + +`func (o *ApiResponse) HasCode() bool` + +HasCode returns a boolean if a field has been set. + +### SetCode + +`func (o *ApiResponse) SetCode(v int32)` + +SetCode gets a reference to the given int32 and assigns it to the Code field. + +### GetType + +`func (o *ApiResponse) GetType() string` + +GetType returns the Type field if non-nil, zero value otherwise. + +### GetTypeOk + +`func (o *ApiResponse) GetTypeOk() (string, bool)` + +GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasType + +`func (o *ApiResponse) HasType() bool` + +HasType returns a boolean if a field has been set. + +### SetType + +`func (o *ApiResponse) SetType(v string)` + +SetType gets a reference to the given string and assigns it to the Type field. + +### GetMessage + +`func (o *ApiResponse) GetMessage() string` + +GetMessage returns the Message field if non-nil, zero value otherwise. + +### GetMessageOk + +`func (o *ApiResponse) GetMessageOk() (string, bool)` + +GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMessage + +`func (o *ApiResponse) HasMessage() bool` + +HasMessage returns a boolean if a field has been set. + +### SetMessage + +`func (o *ApiResponse) SetMessage(v string)` + +SetMessage gets a reference to the given string and assigns it to the Message field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md new file mode 100644 index 00000000000..64ad908ea3b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfArrayOfNumberOnly.md @@ -0,0 +1,39 @@ +# ArrayOfArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayArrayNumber** | Pointer to [**[][]float32**](array.md) | | [optional] + +## Methods + +### GetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32` + +GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. + +### GetArrayArrayNumberOk + +`func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool)` + +GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool` + +HasArrayArrayNumber returns a boolean if a field has been set. + +### SetArrayArrayNumber + +`func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32)` + +SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md new file mode 100644 index 00000000000..0ce95922a5e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayOfNumberOnly.md @@ -0,0 +1,39 @@ +# ArrayOfNumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayNumber** | Pointer to **[]float32** | | [optional] + +## Methods + +### GetArrayNumber + +`func (o *ArrayOfNumberOnly) GetArrayNumber() []float32` + +GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. + +### GetArrayNumberOk + +`func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool)` + +GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayNumber + +`func (o *ArrayOfNumberOnly) HasArrayNumber() bool` + +HasArrayNumber returns a boolean if a field has been set. + +### SetArrayNumber + +`func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32)` + +SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md new file mode 100644 index 00000000000..f7020fadea3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ArrayTest.md @@ -0,0 +1,91 @@ +# ArrayTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ArrayOfString** | Pointer to **[]string** | | [optional] +**ArrayArrayOfInteger** | Pointer to [**[][]int64**](array.md) | | [optional] +**ArrayArrayOfModel** | Pointer to [**[][]ReadOnlyFirst**](array.md) | | [optional] + +## Methods + +### GetArrayOfString + +`func (o *ArrayTest) GetArrayOfString() []string` + +GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. + +### GetArrayOfStringOk + +`func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool)` + +GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayOfString + +`func (o *ArrayTest) HasArrayOfString() bool` + +HasArrayOfString returns a boolean if a field has been set. + +### SetArrayOfString + +`func (o *ArrayTest) SetArrayOfString(v []string)` + +SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. + +### GetArrayArrayOfInteger + +`func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64` + +GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. + +### GetArrayArrayOfIntegerOk + +`func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool)` + +GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayArrayOfInteger + +`func (o *ArrayTest) HasArrayArrayOfInteger() bool` + +HasArrayArrayOfInteger returns a boolean if a field has been set. + +### SetArrayArrayOfInteger + +`func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64)` + +SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. + +### GetArrayArrayOfModel + +`func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst` + +GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. + +### GetArrayArrayOfModelOk + +`func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool)` + +GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayArrayOfModel + +`func (o *ArrayTest) HasArrayArrayOfModel() bool` + +HasArrayArrayOfModel returns a boolean if a field has been set. + +### SetArrayArrayOfModel + +`func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst)` + +SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md new file mode 100644 index 00000000000..a4772d74006 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Capitalization.md @@ -0,0 +1,169 @@ +# Capitalization + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SmallCamel** | Pointer to **string** | | [optional] +**CapitalCamel** | Pointer to **string** | | [optional] +**SmallSnake** | Pointer to **string** | | [optional] +**CapitalSnake** | Pointer to **string** | | [optional] +**SCAETHFlowPoints** | Pointer to **string** | | [optional] +**ATT_NAME** | Pointer to **string** | Name of the pet | [optional] + +## Methods + +### GetSmallCamel + +`func (o *Capitalization) GetSmallCamel() string` + +GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. + +### GetSmallCamelOk + +`func (o *Capitalization) GetSmallCamelOk() (string, bool)` + +GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSmallCamel + +`func (o *Capitalization) HasSmallCamel() bool` + +HasSmallCamel returns a boolean if a field has been set. + +### SetSmallCamel + +`func (o *Capitalization) SetSmallCamel(v string)` + +SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. + +### GetCapitalCamel + +`func (o *Capitalization) GetCapitalCamel() string` + +GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. + +### GetCapitalCamelOk + +`func (o *Capitalization) GetCapitalCamelOk() (string, bool)` + +GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCapitalCamel + +`func (o *Capitalization) HasCapitalCamel() bool` + +HasCapitalCamel returns a boolean if a field has been set. + +### SetCapitalCamel + +`func (o *Capitalization) SetCapitalCamel(v string)` + +SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. + +### GetSmallSnake + +`func (o *Capitalization) GetSmallSnake() string` + +GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. + +### GetSmallSnakeOk + +`func (o *Capitalization) GetSmallSnakeOk() (string, bool)` + +GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSmallSnake + +`func (o *Capitalization) HasSmallSnake() bool` + +HasSmallSnake returns a boolean if a field has been set. + +### SetSmallSnake + +`func (o *Capitalization) SetSmallSnake(v string)` + +SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. + +### GetCapitalSnake + +`func (o *Capitalization) GetCapitalSnake() string` + +GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. + +### GetCapitalSnakeOk + +`func (o *Capitalization) GetCapitalSnakeOk() (string, bool)` + +GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCapitalSnake + +`func (o *Capitalization) HasCapitalSnake() bool` + +HasCapitalSnake returns a boolean if a field has been set. + +### SetCapitalSnake + +`func (o *Capitalization) SetCapitalSnake(v string)` + +SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. + +### GetSCAETHFlowPoints + +`func (o *Capitalization) GetSCAETHFlowPoints() string` + +GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. + +### GetSCAETHFlowPointsOk + +`func (o *Capitalization) GetSCAETHFlowPointsOk() (string, bool)` + +GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSCAETHFlowPoints + +`func (o *Capitalization) HasSCAETHFlowPoints() bool` + +HasSCAETHFlowPoints returns a boolean if a field has been set. + +### SetSCAETHFlowPoints + +`func (o *Capitalization) SetSCAETHFlowPoints(v string)` + +SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. + +### GetATT_NAME + +`func (o *Capitalization) GetATT_NAME() string` + +GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. + +### GetATT_NAMEOk + +`func (o *Capitalization) GetATT_NAMEOk() (string, bool)` + +GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasATT_NAME + +`func (o *Capitalization) HasATT_NAME() bool` + +HasATT_NAME returns a boolean if a field has been set. + +### SetATT_NAME + +`func (o *Capitalization) SetATT_NAME(v string)` + +SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md new file mode 100644 index 00000000000..0f2fe5a1f1f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Cat.md @@ -0,0 +1,91 @@ +# Cat + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### GetClassName + +`func (o *Cat) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Cat) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *Cat) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *Cat) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *Cat) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Cat) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *Cat) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *Cat) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + +### GetDeclawed + +`func (o *Cat) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *Cat) GetDeclawedOk() (bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDeclawed + +`func (o *Cat) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + +### SetDeclawed + +`func (o *Cat) SetDeclawed(v bool)` + +SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md new file mode 100644 index 00000000000..85f40d251d9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/CatAllOf.md @@ -0,0 +1,39 @@ +# CatAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Declawed** | Pointer to **bool** | | [optional] + +## Methods + +### GetDeclawed + +`func (o *CatAllOf) GetDeclawed() bool` + +GetDeclawed returns the Declawed field if non-nil, zero value otherwise. + +### GetDeclawedOk + +`func (o *CatAllOf) GetDeclawedOk() (bool, bool)` + +GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDeclawed + +`func (o *CatAllOf) HasDeclawed() bool` + +HasDeclawed returns a boolean if a field has been set. + +### SetDeclawed + +`func (o *CatAllOf) SetDeclawed(v bool)` + +SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md new file mode 100644 index 00000000000..88b525bade1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Category.md @@ -0,0 +1,65 @@ +# Category + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [default to default-name] + +## Methods + +### GetId + +`func (o *Category) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Category) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Category) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Category) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetName + +`func (o *Category) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Category) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Category) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Category) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md new file mode 100644 index 00000000000..d9c4f41e98b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ClassModel.md @@ -0,0 +1,39 @@ +# ClassModel + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Class** | Pointer to **string** | | [optional] + +## Methods + +### GetClass + +`func (o *ClassModel) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *ClassModel) GetClassOk() (string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClass + +`func (o *ClassModel) HasClass() bool` + +HasClass returns a boolean if a field has been set. + +### SetClass + +`func (o *ClassModel) SetClass(v string)` + +SetClass gets a reference to the given string and assigns it to the Class field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md new file mode 100644 index 00000000000..5ed3098fd49 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Client.md @@ -0,0 +1,39 @@ +# Client + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Client** | Pointer to **string** | | [optional] + +## Methods + +### GetClient + +`func (o *Client) GetClient() string` + +GetClient returns the Client field if non-nil, zero value otherwise. + +### GetClientOk + +`func (o *Client) GetClientOk() (string, bool)` + +GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClient + +`func (o *Client) HasClient() bool` + +HasClient returns a boolean if a field has been set. + +### SetClient + +`func (o *Client) SetClient(v string)` + +SetClient gets a reference to the given string and assigns it to the Client field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md new file mode 100644 index 00000000000..4fd0ab98720 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DefaultApi.md @@ -0,0 +1,36 @@ +# \DefaultApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FooGet**](DefaultApi.md#FooGet) | **Get** /foo | + + + +## FooGet + +> InlineResponseDefault FooGet(ctx, ) + + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + +[**InlineResponseDefault**](inline_response_default.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[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) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md new file mode 100644 index 00000000000..4b5c332d8e1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Dog.md @@ -0,0 +1,91 @@ +# Dog + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ClassName** | Pointer to **string** | | +**Color** | Pointer to **string** | | [optional] [default to red] +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### GetClassName + +`func (o *Dog) GetClassName() string` + +GetClassName returns the ClassName field if non-nil, zero value otherwise. + +### GetClassNameOk + +`func (o *Dog) GetClassNameOk() (string, bool)` + +GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClassName + +`func (o *Dog) HasClassName() bool` + +HasClassName returns a boolean if a field has been set. + +### SetClassName + +`func (o *Dog) SetClassName(v string)` + +SetClassName gets a reference to the given string and assigns it to the ClassName field. + +### GetColor + +`func (o *Dog) GetColor() string` + +GetColor returns the Color field if non-nil, zero value otherwise. + +### GetColorOk + +`func (o *Dog) GetColorOk() (string, bool)` + +GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasColor + +`func (o *Dog) HasColor() bool` + +HasColor returns a boolean if a field has been set. + +### SetColor + +`func (o *Dog) SetColor(v string)` + +SetColor gets a reference to the given string and assigns it to the Color field. + +### GetBreed + +`func (o *Dog) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *Dog) GetBreedOk() (string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBreed + +`func (o *Dog) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + +### SetBreed + +`func (o *Dog) SetBreed(v string)` + +SetBreed gets a reference to the given string and assigns it to the Breed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md new file mode 100644 index 00000000000..a3169521cec --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/DogAllOf.md @@ -0,0 +1,39 @@ +# DogAllOf + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Breed** | Pointer to **string** | | [optional] + +## Methods + +### GetBreed + +`func (o *DogAllOf) GetBreed() string` + +GetBreed returns the Breed field if non-nil, zero value otherwise. + +### GetBreedOk + +`func (o *DogAllOf) GetBreedOk() (string, bool)` + +GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBreed + +`func (o *DogAllOf) HasBreed() bool` + +HasBreed returns a boolean if a field has been set. + +### SetBreed + +`func (o *DogAllOf) SetBreed(v string)` + +SetBreed gets a reference to the given string and assigns it to the Breed field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md new file mode 100644 index 00000000000..31d7b2b9faa --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumArrays.md @@ -0,0 +1,65 @@ +# EnumArrays + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustSymbol** | Pointer to **string** | | [optional] +**ArrayEnum** | Pointer to **[]string** | | [optional] + +## Methods + +### GetJustSymbol + +`func (o *EnumArrays) GetJustSymbol() string` + +GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. + +### GetJustSymbolOk + +`func (o *EnumArrays) GetJustSymbolOk() (string, bool)` + +GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasJustSymbol + +`func (o *EnumArrays) HasJustSymbol() bool` + +HasJustSymbol returns a boolean if a field has been set. + +### SetJustSymbol + +`func (o *EnumArrays) SetJustSymbol(v string)` + +SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. + +### GetArrayEnum + +`func (o *EnumArrays) GetArrayEnum() []string` + +GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. + +### GetArrayEnumOk + +`func (o *EnumArrays) GetArrayEnumOk() ([]string, bool)` + +GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayEnum + +`func (o *EnumArrays) HasArrayEnum() bool` + +HasArrayEnum returns a boolean if a field has been set. + +### SetArrayEnum + +`func (o *EnumArrays) SetArrayEnum(v []string)` + +SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md new file mode 100644 index 00000000000..e231f94bd73 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumClass.md @@ -0,0 +1,11 @@ +# EnumClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md new file mode 100644 index 00000000000..45b1b7e5adb --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/EnumTest.md @@ -0,0 +1,228 @@ +# EnumTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumString** | Pointer to **string** | | [optional] +**EnumStringRequired** | Pointer to **string** | | +**EnumInteger** | Pointer to **int32** | | [optional] +**EnumNumber** | Pointer to **float64** | | [optional] +**OuterEnum** | Pointer to [**OuterEnum**](OuterEnum.md) | | [optional] +**OuterEnumInteger** | Pointer to [**OuterEnumInteger**](OuterEnumInteger.md) | | [optional] +**OuterEnumDefaultValue** | Pointer to [**OuterEnumDefaultValue**](OuterEnumDefaultValue.md) | | [optional] +**OuterEnumIntegerDefaultValue** | Pointer to [**OuterEnumIntegerDefaultValue**](OuterEnumIntegerDefaultValue.md) | | [optional] + +## Methods + +### GetEnumString + +`func (o *EnumTest) GetEnumString() string` + +GetEnumString returns the EnumString field if non-nil, zero value otherwise. + +### GetEnumStringOk + +`func (o *EnumTest) GetEnumStringOk() (string, bool)` + +GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumString + +`func (o *EnumTest) HasEnumString() bool` + +HasEnumString returns a boolean if a field has been set. + +### SetEnumString + +`func (o *EnumTest) SetEnumString(v string)` + +SetEnumString gets a reference to the given string and assigns it to the EnumString field. + +### GetEnumStringRequired + +`func (o *EnumTest) GetEnumStringRequired() string` + +GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. + +### GetEnumStringRequiredOk + +`func (o *EnumTest) GetEnumStringRequiredOk() (string, bool)` + +GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumStringRequired + +`func (o *EnumTest) HasEnumStringRequired() bool` + +HasEnumStringRequired returns a boolean if a field has been set. + +### SetEnumStringRequired + +`func (o *EnumTest) SetEnumStringRequired(v string)` + +SetEnumStringRequired gets a reference to the given string and assigns it to the EnumStringRequired field. + +### GetEnumInteger + +`func (o *EnumTest) GetEnumInteger() int32` + +GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. + +### GetEnumIntegerOk + +`func (o *EnumTest) GetEnumIntegerOk() (int32, bool)` + +GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumInteger + +`func (o *EnumTest) HasEnumInteger() bool` + +HasEnumInteger returns a boolean if a field has been set. + +### SetEnumInteger + +`func (o *EnumTest) SetEnumInteger(v int32)` + +SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. + +### GetEnumNumber + +`func (o *EnumTest) GetEnumNumber() float64` + +GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. + +### GetEnumNumberOk + +`func (o *EnumTest) GetEnumNumberOk() (float64, bool)` + +GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumNumber + +`func (o *EnumTest) HasEnumNumber() bool` + +HasEnumNumber returns a boolean if a field has been set. + +### SetEnumNumber + +`func (o *EnumTest) SetEnumNumber(v float64)` + +SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. + +### GetOuterEnum + +`func (o *EnumTest) GetOuterEnum() OuterEnum` + +GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. + +### GetOuterEnumOk + +`func (o *EnumTest) GetOuterEnumOk() (OuterEnum, bool)` + +GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnum + +`func (o *EnumTest) HasOuterEnum() bool` + +HasOuterEnum returns a boolean if a field has been set. + +### SetOuterEnum + +`func (o *EnumTest) SetOuterEnum(v OuterEnum)` + +SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field. + +### SetOuterEnumExplicitNull + +`func (o *EnumTest) SetOuterEnumExplicitNull(b bool)` + +SetOuterEnumExplicitNull (un)sets OuterEnum to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The OuterEnum value is set to nil even if false is passed +### GetOuterEnumInteger + +`func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger` + +GetOuterEnumInteger returns the OuterEnumInteger field if non-nil, zero value otherwise. + +### GetOuterEnumIntegerOk + +`func (o *EnumTest) GetOuterEnumIntegerOk() (OuterEnumInteger, bool)` + +GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnumInteger + +`func (o *EnumTest) HasOuterEnumInteger() bool` + +HasOuterEnumInteger returns a boolean if a field has been set. + +### SetOuterEnumInteger + +`func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger)` + +SetOuterEnumInteger gets a reference to the given OuterEnumInteger and assigns it to the OuterEnumInteger field. + +### GetOuterEnumDefaultValue + +`func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue` + +GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field if non-nil, zero value otherwise. + +### GetOuterEnumDefaultValueOk + +`func (o *EnumTest) GetOuterEnumDefaultValueOk() (OuterEnumDefaultValue, bool)` + +GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnumDefaultValue + +`func (o *EnumTest) HasOuterEnumDefaultValue() bool` + +HasOuterEnumDefaultValue returns a boolean if a field has been set. + +### SetOuterEnumDefaultValue + +`func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue)` + +SetOuterEnumDefaultValue gets a reference to the given OuterEnumDefaultValue and assigns it to the OuterEnumDefaultValue field. + +### GetOuterEnumIntegerDefaultValue + +`func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue` + +GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field if non-nil, zero value otherwise. + +### GetOuterEnumIntegerDefaultValueOk + +`func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (OuterEnumIntegerDefaultValue, bool)` + +GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasOuterEnumIntegerDefaultValue + +`func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool` + +HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. + +### SetOuterEnumIntegerDefaultValue + +`func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue)` + +SetOuterEnumIntegerDefaultValue gets a reference to the given OuterEnumIntegerDefaultValue and assigns it to the OuterEnumIntegerDefaultValue field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md new file mode 100644 index 00000000000..0c11da8d772 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeApi.md @@ -0,0 +1,573 @@ +# \FakeApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**FakeHealthGet**](FakeApi.md#FakeHealthGet) | **Get** /fake/health | Health check endpoint +[**FakeOuterBooleanSerialize**](FakeApi.md#FakeOuterBooleanSerialize) | **Post** /fake/outer/boolean | +[**FakeOuterCompositeSerialize**](FakeApi.md#FakeOuterCompositeSerialize) | **Post** /fake/outer/composite | +[**FakeOuterNumberSerialize**](FakeApi.md#FakeOuterNumberSerialize) | **Post** /fake/outer/number | +[**FakeOuterStringSerialize**](FakeApi.md#FakeOuterStringSerialize) | **Post** /fake/outer/string | +[**TestBodyWithFileSchema**](FakeApi.md#TestBodyWithFileSchema) | **Put** /fake/body-with-file-schema | +[**TestBodyWithQueryParams**](FakeApi.md#TestBodyWithQueryParams) | **Put** /fake/body-with-query-params | +[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model +[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 +[**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters +[**TestGroupParameters**](FakeApi.md#TestGroupParameters) | **Delete** /fake | Fake endpoint to test group parameters (optional) +[**TestInlineAdditionalProperties**](FakeApi.md#TestInlineAdditionalProperties) | **Post** /fake/inline-additionalProperties | test inline additionalProperties +[**TestJsonFormData**](FakeApi.md#TestJsonFormData) | **Get** /fake/jsonFormData | test json serialization of form data +[**TestQueryParameterCollectionFormat**](FakeApi.md#TestQueryParameterCollectionFormat) | **Put** /fake/test-query-paramters | + + + +## FakeHealthGet + +> HealthCheckResult FakeHealthGet(ctx, ) +Health check endpoint + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + +[**HealthCheckResult**](HealthCheckResult.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[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) + + +## FakeOuterBooleanSerialize + +> bool FakeOuterBooleanSerialize(ctx, optional) + + +Test serialization of outer boolean types + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **optional.Bool**| Input boolean as post body | + +### Return type + +**bool** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## FakeOuterCompositeSerialize + +> OuterComposite FakeOuterCompositeSerialize(ctx, optional) + + +Test serialization of object with outer number type + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **outerComposite** | [**optional.Interface of OuterComposite**](OuterComposite.md)| Input composite as post body | + +### Return type + +[**OuterComposite**](OuterComposite.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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 + +> float32 FakeOuterNumberSerialize(ctx, optional) + + +Test serialization of outer number types + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **optional.Float32**| Input number as post body | + +### Return type + +**float32** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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 + +> string FakeOuterStringSerialize(ctx, optional) + + +Test serialization of outer string types + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | **optional.String**| Input string as post body | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **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) + + +## TestBodyWithFileSchema + +> TestBodyWithFileSchema(ctx, fileSchemaTestClass) + + +For this test, the body for this request much reference a schema named `File`. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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) + + +## TestBodyWithQueryParams + +> TestBodyWithQueryParams(ctx, query, user) + + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**query** | **string**| | +**user** | [**User**](User.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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) + + +## TestClientModel + +> Client TestClientModel(ctx, client) +To test \"client\" model + +To test \"client\" model + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[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) +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**number** | **float32**| None | +**double** | **float64**| None | +**patternWithoutDelimiter** | **string**| None | +**byte_** | **string**| None | + **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + + **integer** | **optional.Int32**| None | + **int32_** | **optional.Int32**| None | + **int64_** | **optional.Int64**| None | + **float** | **optional.Float32**| 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 | + **callback** | **optional.String**| None | + +### Return type + + (empty response body) + +### Authorization + +[http_basic_test](../README.md#http_basic_test) + +### HTTP request headers + +- **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) + + +## TestEnumParameters + +> TestEnumParameters(ctx, optional) +To test enum parameters + +To test enum parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a TestEnumParametersOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **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**](string.md)| Form parameter enum test (string array) | [default to $] + **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **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) + + +## TestGroupParameters + +> TestGroupParameters(ctx, requiredStringGroup, requiredBooleanGroup, requiredInt64Group, optional) +Fake endpoint to test group parameters (optional) + +Fake endpoint to test group parameters (optional) + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requiredStringGroup** | **int32**| Required String in group parameters | +**requiredBooleanGroup** | **bool**| Required Boolean in group parameters | +**requiredInt64Group** | **int64**| Required Integer in group parameters | + **optional** | ***TestGroupParametersOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a TestGroupParametersOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + + **stringGroup** | **optional.Int32**| String in group parameters | + **booleanGroup** | **optional.Bool**| Boolean in group parameters | + **int64Group** | **optional.Int64**| Integer in group parameters | + +### Return type + + (empty response body) + +### Authorization + +[bearer_test](../README.md#bearer_test) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## TestInlineAdditionalProperties + +> TestInlineAdditionalProperties(ctx, requestBody) +test inline additionalProperties + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**requestBody** | [**map[string]string**](string.md)| request body | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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) + + +## TestJsonFormData + +> TestJsonFormData(ctx, param, param2) +test json serialization of form data + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**param** | **string**| field1 | +**param2** | **string**| field2 | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **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) + + +## TestQueryParameterCollectionFormat + +> TestQueryParameterCollectionFormat(ctx, pipe, ioutil, http, url, context) + + +To test the collection format in query parameters + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pipe** | [**[]string**](string.md)| | +**ioutil** | [**[]string**](string.md)| | +**http** | [**[]string**](string.md)| | +**url** | [**[]string**](string.md)| | +**context** | [**[]string**](string.md)| | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md new file mode 100644 index 00000000000..5bf7b3bcc99 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FakeClassnameTags123Api.md @@ -0,0 +1,42 @@ +# \FakeClassnameTags123Api + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**TestClassname**](FakeClassnameTags123Api.md#TestClassname) | **Patch** /fake_classname_test | To test class name in snake case + + + +## TestClassname + +> Client TestClassname(ctx, client) +To test class name in snake case + +To test class name in snake case + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**client** | [**Client**](Client.md)| client model | + +### Return type + +[**Client**](Client.md) + +### Authorization + +[api_key_query](../README.md#api_key_query) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[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) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md new file mode 100644 index 00000000000..454b159609c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/File.md @@ -0,0 +1,39 @@ +# File + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SourceURI** | Pointer to **string** | Test capitalization | [optional] + +## Methods + +### GetSourceURI + +`func (o *File) GetSourceURI() string` + +GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. + +### GetSourceURIOk + +`func (o *File) GetSourceURIOk() (string, bool)` + +GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSourceURI + +`func (o *File) HasSourceURI() bool` + +HasSourceURI returns a boolean if a field has been set. + +### SetSourceURI + +`func (o *File) SetSourceURI(v string)` + +SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md new file mode 100644 index 00000000000..d4a4da7206c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FileSchemaTestClass.md @@ -0,0 +1,65 @@ +# FileSchemaTestClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**File** | Pointer to [**File**](File.md) | | [optional] +**Files** | Pointer to [**[]File**](File.md) | | [optional] + +## Methods + +### GetFile + +`func (o *FileSchemaTestClass) GetFile() File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *FileSchemaTestClass) GetFileOk() (File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFile + +`func (o *FileSchemaTestClass) HasFile() bool` + +HasFile returns a boolean if a field has been set. + +### SetFile + +`func (o *FileSchemaTestClass) SetFile(v File)` + +SetFile gets a reference to the given File and assigns it to the File field. + +### GetFiles + +`func (o *FileSchemaTestClass) GetFiles() []File` + +GetFiles returns the Files field if non-nil, zero value otherwise. + +### GetFilesOk + +`func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool)` + +GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFiles + +`func (o *FileSchemaTestClass) HasFiles() bool` + +HasFiles returns a boolean if a field has been set. + +### SetFiles + +`func (o *FileSchemaTestClass) SetFiles(v []File)` + +SetFiles gets a reference to the given []File and assigns it to the Files field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md new file mode 100644 index 00000000000..82e3c253f2e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Foo.md @@ -0,0 +1,39 @@ +# Foo + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | Pointer to **string** | | [optional] [default to bar] + +## Methods + +### GetBar + +`func (o *Foo) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *Foo) GetBarOk() (string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBar + +`func (o *Foo) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### SetBar + +`func (o *Foo) SetBar(v string)` + +SetBar gets a reference to the given string and assigns it to the Bar field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md new file mode 100644 index 00000000000..861d7aa3eb1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/FormatTest.md @@ -0,0 +1,403 @@ +# FormatTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | Pointer to **int32** | | [optional] +**Int32** | Pointer to **int32** | | [optional] +**Int64** | Pointer to **int64** | | [optional] +**Number** | Pointer to **float32** | | +**Float** | Pointer to **float32** | | [optional] +**Double** | Pointer to **float64** | | [optional] +**String** | Pointer to **string** | | [optional] +**Byte** | Pointer to **string** | | +**Binary** | Pointer to [***os.File**](*os.File.md) | | [optional] +**Date** | Pointer to **string** | | +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Uuid** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | +**PatternWithDigits** | Pointer to **string** | A string that is a 10 digit number. Can have leading zeros. | [optional] +**PatternWithDigitsAndDelimiter** | Pointer to **string** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional] + +## Methods + +### GetInteger + +`func (o *FormatTest) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *FormatTest) GetIntegerOk() (int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInteger + +`func (o *FormatTest) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### SetInteger + +`func (o *FormatTest) SetInteger(v int32)` + +SetInteger gets a reference to the given int32 and assigns it to the Integer field. + +### GetInt32 + +`func (o *FormatTest) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *FormatTest) GetInt32Ok() (int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt32 + +`func (o *FormatTest) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### SetInt32 + +`func (o *FormatTest) SetInt32(v int32)` + +SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. + +### GetInt64 + +`func (o *FormatTest) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *FormatTest) GetInt64Ok() (int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt64 + +`func (o *FormatTest) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### SetInt64 + +`func (o *FormatTest) SetInt64(v int64)` + +SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. + +### GetNumber + +`func (o *FormatTest) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *FormatTest) GetNumberOk() (float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNumber + +`func (o *FormatTest) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### SetNumber + +`func (o *FormatTest) SetNumber(v float32)` + +SetNumber gets a reference to the given float32 and assigns it to the Number field. + +### GetFloat + +`func (o *FormatTest) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *FormatTest) GetFloatOk() (float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFloat + +`func (o *FormatTest) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### SetFloat + +`func (o *FormatTest) SetFloat(v float32)` + +SetFloat gets a reference to the given float32 and assigns it to the Float field. + +### GetDouble + +`func (o *FormatTest) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *FormatTest) GetDoubleOk() (float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDouble + +`func (o *FormatTest) HasDouble() bool` + +HasDouble returns a boolean if a field has been set. + +### SetDouble + +`func (o *FormatTest) SetDouble(v float64)` + +SetDouble gets a reference to the given float64 and assigns it to the Double field. + +### GetString + +`func (o *FormatTest) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *FormatTest) GetStringOk() (string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasString + +`func (o *FormatTest) HasString() bool` + +HasString returns a boolean if a field has been set. + +### SetString + +`func (o *FormatTest) SetString(v string)` + +SetString gets a reference to the given string and assigns it to the String field. + +### GetByte + +`func (o *FormatTest) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *FormatTest) GetByteOk() (string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasByte + +`func (o *FormatTest) HasByte() bool` + +HasByte returns a boolean if a field has been set. + +### SetByte + +`func (o *FormatTest) SetByte(v string)` + +SetByte gets a reference to the given string and assigns it to the Byte field. + +### GetBinary + +`func (o *FormatTest) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *FormatTest) GetBinaryOk() (*os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBinary + +`func (o *FormatTest) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### SetBinary + +`func (o *FormatTest) SetBinary(v *os.File)` + +SetBinary gets a reference to the given *os.File and assigns it to the Binary field. + +### GetDate + +`func (o *FormatTest) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *FormatTest) GetDateOk() (string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDate + +`func (o *FormatTest) HasDate() bool` + +HasDate returns a boolean if a field has been set. + +### SetDate + +`func (o *FormatTest) SetDate(v string)` + +SetDate gets a reference to the given string and assigns it to the Date field. + +### GetDateTime + +`func (o *FormatTest) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *FormatTest) GetDateTimeOk() (time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateTime + +`func (o *FormatTest) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### SetDateTime + +`func (o *FormatTest) SetDateTime(v time.Time)` + +SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. + +### GetUuid + +`func (o *FormatTest) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *FormatTest) GetUuidOk() (string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUuid + +`func (o *FormatTest) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### SetUuid + +`func (o *FormatTest) SetUuid(v string)` + +SetUuid gets a reference to the given string and assigns it to the Uuid field. + +### GetPassword + +`func (o *FormatTest) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *FormatTest) GetPasswordOk() (string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPassword + +`func (o *FormatTest) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPassword + +`func (o *FormatTest) SetPassword(v string)` + +SetPassword gets a reference to the given string and assigns it to the Password field. + +### GetPatternWithDigits + +`func (o *FormatTest) GetPatternWithDigits() string` + +GetPatternWithDigits returns the PatternWithDigits field if non-nil, zero value otherwise. + +### GetPatternWithDigitsOk + +`func (o *FormatTest) GetPatternWithDigitsOk() (string, bool)` + +GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPatternWithDigits + +`func (o *FormatTest) HasPatternWithDigits() bool` + +HasPatternWithDigits returns a boolean if a field has been set. + +### SetPatternWithDigits + +`func (o *FormatTest) SetPatternWithDigits(v string)` + +SetPatternWithDigits gets a reference to the given string and assigns it to the PatternWithDigits field. + +### GetPatternWithDigitsAndDelimiter + +`func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string` + +GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field if non-nil, zero value otherwise. + +### GetPatternWithDigitsAndDelimiterOk + +`func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (string, bool)` + +GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPatternWithDigitsAndDelimiter + +`func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool` + +HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. + +### SetPatternWithDigitsAndDelimiter + +`func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string)` + +SetPatternWithDigitsAndDelimiter gets a reference to the given string and assigns it to the PatternWithDigitsAndDelimiter field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md new file mode 100644 index 00000000000..78f67041d33 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HasOnlyReadOnly.md @@ -0,0 +1,65 @@ +# HasOnlyReadOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | Pointer to **string** | | [optional] +**Foo** | Pointer to **string** | | [optional] + +## Methods + +### GetBar + +`func (o *HasOnlyReadOnly) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *HasOnlyReadOnly) GetBarOk() (string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBar + +`func (o *HasOnlyReadOnly) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### SetBar + +`func (o *HasOnlyReadOnly) SetBar(v string)` + +SetBar gets a reference to the given string and assigns it to the Bar field. + +### GetFoo + +`func (o *HasOnlyReadOnly) GetFoo() string` + +GetFoo returns the Foo field if non-nil, zero value otherwise. + +### GetFooOk + +`func (o *HasOnlyReadOnly) GetFooOk() (string, bool)` + +GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFoo + +`func (o *HasOnlyReadOnly) HasFoo() bool` + +HasFoo returns a boolean if a field has been set. + +### SetFoo + +`func (o *HasOnlyReadOnly) SetFoo(v string)` + +SetFoo gets a reference to the given string and assigns it to the Foo field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md new file mode 100644 index 00000000000..63f7a2fa846 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/HealthCheckResult.md @@ -0,0 +1,46 @@ +# HealthCheckResult + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NullableMessage** | Pointer to **string** | | [optional] + +## Methods + +### GetNullableMessage + +`func (o *HealthCheckResult) GetNullableMessage() string` + +GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise. + +### GetNullableMessageOk + +`func (o *HealthCheckResult) GetNullableMessageOk() (string, bool)` + +GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNullableMessage + +`func (o *HealthCheckResult) HasNullableMessage() bool` + +HasNullableMessage returns a boolean if a field has been set. + +### SetNullableMessage + +`func (o *HealthCheckResult) SetNullableMessage(v string)` + +SetNullableMessage gets a reference to the given string and assigns it to the NullableMessage field. + +### SetNullableMessageExplicitNull + +`func (o *HealthCheckResult) SetNullableMessageExplicitNull(b bool)` + +SetNullableMessageExplicitNull (un)sets NullableMessage to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The NullableMessage value is set to nil even if false is passed + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md new file mode 100644 index 00000000000..0c93a8999ad --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject.md @@ -0,0 +1,65 @@ +# InlineObject + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **string** | Updated name of the pet | [optional] +**Status** | Pointer to **string** | Updated status of the pet | [optional] + +## Methods + +### GetName + +`func (o *InlineObject) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *InlineObject) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *InlineObject) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *InlineObject) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + +### GetStatus + +`func (o *InlineObject) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *InlineObject) GetStatusOk() (string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStatus + +`func (o *InlineObject) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatus + +`func (o *InlineObject) SetStatus(v string)` + +SetStatus gets a reference to the given string and assigns it to the Status field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md new file mode 100644 index 00000000000..f30ef94a837 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject1.md @@ -0,0 +1,65 @@ +# InlineObject1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] +**File** | Pointer to [***os.File**](*os.File.md) | file to upload | [optional] + +## Methods + +### GetAdditionalMetadata + +`func (o *InlineObject1) GetAdditionalMetadata() string` + +GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. + +### GetAdditionalMetadataOk + +`func (o *InlineObject1) GetAdditionalMetadataOk() (string, bool)` + +GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasAdditionalMetadata + +`func (o *InlineObject1) HasAdditionalMetadata() bool` + +HasAdditionalMetadata returns a boolean if a field has been set. + +### SetAdditionalMetadata + +`func (o *InlineObject1) SetAdditionalMetadata(v string)` + +SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. + +### GetFile + +`func (o *InlineObject1) GetFile() *os.File` + +GetFile returns the File field if non-nil, zero value otherwise. + +### GetFileOk + +`func (o *InlineObject1) GetFileOk() (*os.File, bool)` + +GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFile + +`func (o *InlineObject1) HasFile() bool` + +HasFile returns a boolean if a field has been set. + +### SetFile + +`func (o *InlineObject1) SetFile(v *os.File)` + +SetFile gets a reference to the given *os.File and assigns it to the File field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md new file mode 100644 index 00000000000..62a7142a4d0 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject2.md @@ -0,0 +1,65 @@ +# InlineObject2 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnumFormStringArray** | Pointer to **[]string** | Form parameter enum test (string array) | [optional] +**EnumFormString** | Pointer to **string** | Form parameter enum test (string) | [optional] [default to ENUM_FORM_STRING_EFG] + +## Methods + +### GetEnumFormStringArray + +`func (o *InlineObject2) GetEnumFormStringArray() []string` + +GetEnumFormStringArray returns the EnumFormStringArray field if non-nil, zero value otherwise. + +### GetEnumFormStringArrayOk + +`func (o *InlineObject2) GetEnumFormStringArrayOk() ([]string, bool)` + +GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumFormStringArray + +`func (o *InlineObject2) HasEnumFormStringArray() bool` + +HasEnumFormStringArray returns a boolean if a field has been set. + +### SetEnumFormStringArray + +`func (o *InlineObject2) SetEnumFormStringArray(v []string)` + +SetEnumFormStringArray gets a reference to the given []string and assigns it to the EnumFormStringArray field. + +### GetEnumFormString + +`func (o *InlineObject2) GetEnumFormString() string` + +GetEnumFormString returns the EnumFormString field if non-nil, zero value otherwise. + +### GetEnumFormStringOk + +`func (o *InlineObject2) GetEnumFormStringOk() (string, bool)` + +GetEnumFormStringOk returns a tuple with the EnumFormString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEnumFormString + +`func (o *InlineObject2) HasEnumFormString() bool` + +HasEnumFormString returns a boolean if a field has been set. + +### SetEnumFormString + +`func (o *InlineObject2) SetEnumFormString(v string)` + +SetEnumFormString gets a reference to the given string and assigns it to the EnumFormString field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md new file mode 100644 index 00000000000..911b0ffb918 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject3.md @@ -0,0 +1,377 @@ +# InlineObject3 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Integer** | Pointer to **int32** | None | [optional] +**Int32** | Pointer to **int32** | None | [optional] +**Int64** | Pointer to **int64** | None | [optional] +**Number** | Pointer to **float32** | None | +**Float** | Pointer to **float32** | None | [optional] +**Double** | Pointer to **float64** | None | +**String** | Pointer to **string** | None | [optional] +**PatternWithoutDelimiter** | Pointer to **string** | None | +**Byte** | Pointer to **string** | None | +**Binary** | Pointer to [***os.File**](*os.File.md) | None | [optional] +**Date** | Pointer to **string** | None | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | None | [optional] +**Password** | Pointer to **string** | None | [optional] +**Callback** | Pointer to **string** | None | [optional] + +## Methods + +### GetInteger + +`func (o *InlineObject3) GetInteger() int32` + +GetInteger returns the Integer field if non-nil, zero value otherwise. + +### GetIntegerOk + +`func (o *InlineObject3) GetIntegerOk() (int32, bool)` + +GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInteger + +`func (o *InlineObject3) HasInteger() bool` + +HasInteger returns a boolean if a field has been set. + +### SetInteger + +`func (o *InlineObject3) SetInteger(v int32)` + +SetInteger gets a reference to the given int32 and assigns it to the Integer field. + +### GetInt32 + +`func (o *InlineObject3) GetInt32() int32` + +GetInt32 returns the Int32 field if non-nil, zero value otherwise. + +### GetInt32Ok + +`func (o *InlineObject3) GetInt32Ok() (int32, bool)` + +GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt32 + +`func (o *InlineObject3) HasInt32() bool` + +HasInt32 returns a boolean if a field has been set. + +### SetInt32 + +`func (o *InlineObject3) SetInt32(v int32)` + +SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. + +### GetInt64 + +`func (o *InlineObject3) GetInt64() int64` + +GetInt64 returns the Int64 field if non-nil, zero value otherwise. + +### GetInt64Ok + +`func (o *InlineObject3) GetInt64Ok() (int64, bool)` + +GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasInt64 + +`func (o *InlineObject3) HasInt64() bool` + +HasInt64 returns a boolean if a field has been set. + +### SetInt64 + +`func (o *InlineObject3) SetInt64(v int64)` + +SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. + +### GetNumber + +`func (o *InlineObject3) GetNumber() float32` + +GetNumber returns the Number field if non-nil, zero value otherwise. + +### GetNumberOk + +`func (o *InlineObject3) GetNumberOk() (float32, bool)` + +GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNumber + +`func (o *InlineObject3) HasNumber() bool` + +HasNumber returns a boolean if a field has been set. + +### SetNumber + +`func (o *InlineObject3) SetNumber(v float32)` + +SetNumber gets a reference to the given float32 and assigns it to the Number field. + +### GetFloat + +`func (o *InlineObject3) GetFloat() float32` + +GetFloat returns the Float field if non-nil, zero value otherwise. + +### GetFloatOk + +`func (o *InlineObject3) GetFloatOk() (float32, bool)` + +GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFloat + +`func (o *InlineObject3) HasFloat() bool` + +HasFloat returns a boolean if a field has been set. + +### SetFloat + +`func (o *InlineObject3) SetFloat(v float32)` + +SetFloat gets a reference to the given float32 and assigns it to the Float field. + +### GetDouble + +`func (o *InlineObject3) GetDouble() float64` + +GetDouble returns the Double field if non-nil, zero value otherwise. + +### GetDoubleOk + +`func (o *InlineObject3) GetDoubleOk() (float64, bool)` + +GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDouble + +`func (o *InlineObject3) HasDouble() bool` + +HasDouble returns a boolean if a field has been set. + +### SetDouble + +`func (o *InlineObject3) SetDouble(v float64)` + +SetDouble gets a reference to the given float64 and assigns it to the Double field. + +### GetString + +`func (o *InlineObject3) GetString() string` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *InlineObject3) GetStringOk() (string, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasString + +`func (o *InlineObject3) HasString() bool` + +HasString returns a boolean if a field has been set. + +### SetString + +`func (o *InlineObject3) SetString(v string)` + +SetString gets a reference to the given string and assigns it to the String field. + +### GetPatternWithoutDelimiter + +`func (o *InlineObject3) GetPatternWithoutDelimiter() string` + +GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field if non-nil, zero value otherwise. + +### GetPatternWithoutDelimiterOk + +`func (o *InlineObject3) GetPatternWithoutDelimiterOk() (string, bool)` + +GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPatternWithoutDelimiter + +`func (o *InlineObject3) HasPatternWithoutDelimiter() bool` + +HasPatternWithoutDelimiter returns a boolean if a field has been set. + +### SetPatternWithoutDelimiter + +`func (o *InlineObject3) SetPatternWithoutDelimiter(v string)` + +SetPatternWithoutDelimiter gets a reference to the given string and assigns it to the PatternWithoutDelimiter field. + +### GetByte + +`func (o *InlineObject3) GetByte() string` + +GetByte returns the Byte field if non-nil, zero value otherwise. + +### GetByteOk + +`func (o *InlineObject3) GetByteOk() (string, bool)` + +GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasByte + +`func (o *InlineObject3) HasByte() bool` + +HasByte returns a boolean if a field has been set. + +### SetByte + +`func (o *InlineObject3) SetByte(v string)` + +SetByte gets a reference to the given string and assigns it to the Byte field. + +### GetBinary + +`func (o *InlineObject3) GetBinary() *os.File` + +GetBinary returns the Binary field if non-nil, zero value otherwise. + +### GetBinaryOk + +`func (o *InlineObject3) GetBinaryOk() (*os.File, bool)` + +GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBinary + +`func (o *InlineObject3) HasBinary() bool` + +HasBinary returns a boolean if a field has been set. + +### SetBinary + +`func (o *InlineObject3) SetBinary(v *os.File)` + +SetBinary gets a reference to the given *os.File and assigns it to the Binary field. + +### GetDate + +`func (o *InlineObject3) GetDate() string` + +GetDate returns the Date field if non-nil, zero value otherwise. + +### GetDateOk + +`func (o *InlineObject3) GetDateOk() (string, bool)` + +GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDate + +`func (o *InlineObject3) HasDate() bool` + +HasDate returns a boolean if a field has been set. + +### SetDate + +`func (o *InlineObject3) SetDate(v string)` + +SetDate gets a reference to the given string and assigns it to the Date field. + +### GetDateTime + +`func (o *InlineObject3) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *InlineObject3) GetDateTimeOk() (time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateTime + +`func (o *InlineObject3) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### SetDateTime + +`func (o *InlineObject3) SetDateTime(v time.Time)` + +SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. + +### GetPassword + +`func (o *InlineObject3) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *InlineObject3) GetPasswordOk() (string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPassword + +`func (o *InlineObject3) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPassword + +`func (o *InlineObject3) SetPassword(v string)` + +SetPassword gets a reference to the given string and assigns it to the Password field. + +### GetCallback + +`func (o *InlineObject3) GetCallback() string` + +GetCallback returns the Callback field if non-nil, zero value otherwise. + +### GetCallbackOk + +`func (o *InlineObject3) GetCallbackOk() (string, bool)` + +GetCallbackOk returns a tuple with the Callback field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCallback + +`func (o *InlineObject3) HasCallback() bool` + +HasCallback returns a boolean if a field has been set. + +### SetCallback + +`func (o *InlineObject3) SetCallback(v string)` + +SetCallback gets a reference to the given string and assigns it to the Callback field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md new file mode 100644 index 00000000000..8316407b652 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject4.md @@ -0,0 +1,65 @@ +# InlineObject4 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Param** | Pointer to **string** | field1 | +**Param2** | Pointer to **string** | field2 | + +## Methods + +### GetParam + +`func (o *InlineObject4) GetParam() string` + +GetParam returns the Param field if non-nil, zero value otherwise. + +### GetParamOk + +`func (o *InlineObject4) GetParamOk() (string, bool)` + +GetParamOk returns a tuple with the Param field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasParam + +`func (o *InlineObject4) HasParam() bool` + +HasParam returns a boolean if a field has been set. + +### SetParam + +`func (o *InlineObject4) SetParam(v string)` + +SetParam gets a reference to the given string and assigns it to the Param field. + +### GetParam2 + +`func (o *InlineObject4) GetParam2() string` + +GetParam2 returns the Param2 field if non-nil, zero value otherwise. + +### GetParam2Ok + +`func (o *InlineObject4) GetParam2Ok() (string, bool)` + +GetParam2Ok returns a tuple with the Param2 field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasParam2 + +`func (o *InlineObject4) HasParam2() bool` + +HasParam2 returns a boolean if a field has been set. + +### SetParam2 + +`func (o *InlineObject4) SetParam2(v string)` + +SetParam2 gets a reference to the given string and assigns it to the Param2 field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md new file mode 100644 index 00000000000..24aa799df39 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineObject5.md @@ -0,0 +1,65 @@ +# InlineObject5 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdditionalMetadata** | Pointer to **string** | Additional data to pass to server | [optional] +**RequiredFile** | Pointer to [***os.File**](*os.File.md) | file to upload | + +## Methods + +### GetAdditionalMetadata + +`func (o *InlineObject5) GetAdditionalMetadata() string` + +GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. + +### GetAdditionalMetadataOk + +`func (o *InlineObject5) GetAdditionalMetadataOk() (string, bool)` + +GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasAdditionalMetadata + +`func (o *InlineObject5) HasAdditionalMetadata() bool` + +HasAdditionalMetadata returns a boolean if a field has been set. + +### SetAdditionalMetadata + +`func (o *InlineObject5) SetAdditionalMetadata(v string)` + +SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. + +### GetRequiredFile + +`func (o *InlineObject5) GetRequiredFile() *os.File` + +GetRequiredFile returns the RequiredFile field if non-nil, zero value otherwise. + +### GetRequiredFileOk + +`func (o *InlineObject5) GetRequiredFileOk() (*os.File, bool)` + +GetRequiredFileOk returns a tuple with the RequiredFile field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasRequiredFile + +`func (o *InlineObject5) HasRequiredFile() bool` + +HasRequiredFile returns a boolean if a field has been set. + +### SetRequiredFile + +`func (o *InlineObject5) SetRequiredFile(v *os.File)` + +SetRequiredFile gets a reference to the given *os.File and assigns it to the RequiredFile field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md new file mode 100644 index 00000000000..714067d561b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/InlineResponseDefault.md @@ -0,0 +1,39 @@ +# InlineResponseDefault + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**String** | Pointer to [**Foo**](Foo.md) | | [optional] + +## Methods + +### GetString + +`func (o *InlineResponseDefault) GetString() Foo` + +GetString returns the String field if non-nil, zero value otherwise. + +### GetStringOk + +`func (o *InlineResponseDefault) GetStringOk() (Foo, bool)` + +GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasString + +`func (o *InlineResponseDefault) HasString() bool` + +HasString returns a boolean if a field has been set. + +### SetString + +`func (o *InlineResponseDefault) SetString(v Foo)` + +SetString gets a reference to the given Foo and assigns it to the String field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md new file mode 100644 index 00000000000..ca8849936e7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/List.md @@ -0,0 +1,39 @@ +# List + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Var123List** | Pointer to **string** | | [optional] + +## Methods + +### GetVar123List + +`func (o *List) GetVar123List() string` + +GetVar123List returns the Var123List field if non-nil, zero value otherwise. + +### GetVar123ListOk + +`func (o *List) GetVar123ListOk() (string, bool)` + +GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasVar123List + +`func (o *List) HasVar123List() bool` + +HasVar123List returns a boolean if a field has been set. + +### SetVar123List + +`func (o *List) SetVar123List(v string)` + +SetVar123List gets a reference to the given string and assigns it to the Var123List field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md new file mode 100644 index 00000000000..6c84c2e89c2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MapTest.md @@ -0,0 +1,117 @@ +# MapTest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MapMapOfString** | Pointer to [**map[string]map[string]string**](map.md) | | [optional] +**MapOfEnumString** | Pointer to **map[string]string** | | [optional] +**DirectMap** | Pointer to **map[string]bool** | | [optional] +**IndirectMap** | Pointer to **map[string]bool** | | [optional] + +## Methods + +### GetMapMapOfString + +`func (o *MapTest) GetMapMapOfString() map[string]map[string]string` + +GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. + +### GetMapMapOfStringOk + +`func (o *MapTest) GetMapMapOfStringOk() (map[string]map[string]string, bool)` + +GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapMapOfString + +`func (o *MapTest) HasMapMapOfString() bool` + +HasMapMapOfString returns a boolean if a field has been set. + +### SetMapMapOfString + +`func (o *MapTest) SetMapMapOfString(v map[string]map[string]string)` + +SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. + +### GetMapOfEnumString + +`func (o *MapTest) GetMapOfEnumString() map[string]string` + +GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. + +### GetMapOfEnumStringOk + +`func (o *MapTest) GetMapOfEnumStringOk() (map[string]string, bool)` + +GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMapOfEnumString + +`func (o *MapTest) HasMapOfEnumString() bool` + +HasMapOfEnumString returns a boolean if a field has been set. + +### SetMapOfEnumString + +`func (o *MapTest) SetMapOfEnumString(v map[string]string)` + +SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. + +### GetDirectMap + +`func (o *MapTest) GetDirectMap() map[string]bool` + +GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. + +### GetDirectMapOk + +`func (o *MapTest) GetDirectMapOk() (map[string]bool, bool)` + +GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDirectMap + +`func (o *MapTest) HasDirectMap() bool` + +HasDirectMap returns a boolean if a field has been set. + +### SetDirectMap + +`func (o *MapTest) SetDirectMap(v map[string]bool)` + +SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. + +### GetIndirectMap + +`func (o *MapTest) GetIndirectMap() map[string]bool` + +GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. + +### GetIndirectMapOk + +`func (o *MapTest) GetIndirectMapOk() (map[string]bool, bool)` + +GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasIndirectMap + +`func (o *MapTest) HasIndirectMap() bool` + +HasIndirectMap returns a boolean if a field has been set. + +### SetIndirectMap + +`func (o *MapTest) SetIndirectMap(v map[string]bool)` + +SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md new file mode 100644 index 00000000000..49f7c8eb768 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/MixedPropertiesAndAdditionalPropertiesClass.md @@ -0,0 +1,91 @@ +# MixedPropertiesAndAdditionalPropertiesClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Uuid** | Pointer to **string** | | [optional] +**DateTime** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Map** | Pointer to [**map[string]Animal**](Animal.md) | | [optional] + +## Methods + +### GetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string` + +GetUuid returns the Uuid field if non-nil, zero value otherwise. + +### GetUuidOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (string, bool)` + +GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool` + +HasUuid returns a boolean if a field has been set. + +### SetUuid + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string)` + +SetUuid gets a reference to the given string and assigns it to the Uuid field. + +### GetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time` + +GetDateTime returns the DateTime field if non-nil, zero value otherwise. + +### GetDateTimeOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (time.Time, bool)` + +GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool` + +HasDateTime returns a boolean if a field has been set. + +### SetDateTime + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time)` + +SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. + +### GetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal` + +GetMap returns the Map field if non-nil, zero value otherwise. + +### GetMapOk + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (map[string]Animal, bool)` + +GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool` + +HasMap returns a boolean if a field has been set. + +### SetMap + +`func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal)` + +SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md new file mode 100644 index 00000000000..d0bde7b7f7b --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Model200Response.md @@ -0,0 +1,65 @@ +# Model200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **int32** | | [optional] +**Class** | Pointer to **string** | | [optional] + +## Methods + +### GetName + +`func (o *Model200Response) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Model200Response) GetNameOk() (int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Model200Response) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Model200Response) SetName(v int32)` + +SetName gets a reference to the given int32 and assigns it to the Name field. + +### GetClass + +`func (o *Model200Response) GetClass() string` + +GetClass returns the Class field if non-nil, zero value otherwise. + +### GetClassOk + +`func (o *Model200Response) GetClassOk() (string, bool)` + +GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasClass + +`func (o *Model200Response) HasClass() bool` + +HasClass returns a boolean if a field has been set. + +### SetClass + +`func (o *Model200Response) SetClass(v string)` + +SetClass gets a reference to the given string and assigns it to the Class field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md new file mode 100644 index 00000000000..7cc6fd6a3a4 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Name.md @@ -0,0 +1,117 @@ +# Name + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | Pointer to **int32** | | +**SnakeCase** | Pointer to **int32** | | [optional] +**Property** | Pointer to **string** | | [optional] +**Var123Number** | Pointer to **int32** | | [optional] + +## Methods + +### GetName + +`func (o *Name) GetName() int32` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Name) GetNameOk() (int32, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Name) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Name) SetName(v int32)` + +SetName gets a reference to the given int32 and assigns it to the Name field. + +### GetSnakeCase + +`func (o *Name) GetSnakeCase() int32` + +GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. + +### GetSnakeCaseOk + +`func (o *Name) GetSnakeCaseOk() (int32, bool)` + +GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSnakeCase + +`func (o *Name) HasSnakeCase() bool` + +HasSnakeCase returns a boolean if a field has been set. + +### SetSnakeCase + +`func (o *Name) SetSnakeCase(v int32)` + +SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. + +### GetProperty + +`func (o *Name) GetProperty() string` + +GetProperty returns the Property field if non-nil, zero value otherwise. + +### GetPropertyOk + +`func (o *Name) GetPropertyOk() (string, bool)` + +GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasProperty + +`func (o *Name) HasProperty() bool` + +HasProperty returns a boolean if a field has been set. + +### SetProperty + +`func (o *Name) SetProperty(v string)` + +SetProperty gets a reference to the given string and assigns it to the Property field. + +### GetVar123Number + +`func (o *Name) GetVar123Number() int32` + +GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. + +### GetVar123NumberOk + +`func (o *Name) GetVar123NumberOk() (int32, bool)` + +GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasVar123Number + +`func (o *Name) HasVar123Number() bool` + +HasVar123Number returns a boolean if a field has been set. + +### SetVar123Number + +`func (o *Name) SetVar123Number(v int32)` + +SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md new file mode 100644 index 00000000000..65067eda2ae --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NullableClass.md @@ -0,0 +1,395 @@ +# NullableClass + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegerProp** | Pointer to **int32** | | [optional] +**NumberProp** | Pointer to **float32** | | [optional] +**BooleanProp** | Pointer to **bool** | | [optional] +**StringProp** | Pointer to **string** | | [optional] +**DateProp** | Pointer to **string** | | [optional] +**DatetimeProp** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**ArrayNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ArrayAndItemsNullableProp** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ArrayItemsNullable** | Pointer to [**[]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectAndItemsNullableProp** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] +**ObjectItemsNullable** | Pointer to [**map[string]map[string]interface{}**](map[string]interface{}.md) | | [optional] + +## Methods + +### GetIntegerProp + +`func (o *NullableClass) GetIntegerProp() int32` + +GetIntegerProp returns the IntegerProp field if non-nil, zero value otherwise. + +### GetIntegerPropOk + +`func (o *NullableClass) GetIntegerPropOk() (int32, bool)` + +GetIntegerPropOk returns a tuple with the IntegerProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasIntegerProp + +`func (o *NullableClass) HasIntegerProp() bool` + +HasIntegerProp returns a boolean if a field has been set. + +### SetIntegerProp + +`func (o *NullableClass) SetIntegerProp(v int32)` + +SetIntegerProp gets a reference to the given int32 and assigns it to the IntegerProp field. + +### SetIntegerPropExplicitNull + +`func (o *NullableClass) SetIntegerPropExplicitNull(b bool)` + +SetIntegerPropExplicitNull (un)sets IntegerProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The IntegerProp value is set to nil even if false is passed +### GetNumberProp + +`func (o *NullableClass) GetNumberProp() float32` + +GetNumberProp returns the NumberProp field if non-nil, zero value otherwise. + +### GetNumberPropOk + +`func (o *NullableClass) GetNumberPropOk() (float32, bool)` + +GetNumberPropOk returns a tuple with the NumberProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasNumberProp + +`func (o *NullableClass) HasNumberProp() bool` + +HasNumberProp returns a boolean if a field has been set. + +### SetNumberProp + +`func (o *NullableClass) SetNumberProp(v float32)` + +SetNumberProp gets a reference to the given float32 and assigns it to the NumberProp field. + +### SetNumberPropExplicitNull + +`func (o *NullableClass) SetNumberPropExplicitNull(b bool)` + +SetNumberPropExplicitNull (un)sets NumberProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The NumberProp value is set to nil even if false is passed +### GetBooleanProp + +`func (o *NullableClass) GetBooleanProp() bool` + +GetBooleanProp returns the BooleanProp field if non-nil, zero value otherwise. + +### GetBooleanPropOk + +`func (o *NullableClass) GetBooleanPropOk() (bool, bool)` + +GetBooleanPropOk returns a tuple with the BooleanProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBooleanProp + +`func (o *NullableClass) HasBooleanProp() bool` + +HasBooleanProp returns a boolean if a field has been set. + +### SetBooleanProp + +`func (o *NullableClass) SetBooleanProp(v bool)` + +SetBooleanProp gets a reference to the given bool and assigns it to the BooleanProp field. + +### SetBooleanPropExplicitNull + +`func (o *NullableClass) SetBooleanPropExplicitNull(b bool)` + +SetBooleanPropExplicitNull (un)sets BooleanProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The BooleanProp value is set to nil even if false is passed +### GetStringProp + +`func (o *NullableClass) GetStringProp() string` + +GetStringProp returns the StringProp field if non-nil, zero value otherwise. + +### GetStringPropOk + +`func (o *NullableClass) GetStringPropOk() (string, bool)` + +GetStringPropOk returns a tuple with the StringProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStringProp + +`func (o *NullableClass) HasStringProp() bool` + +HasStringProp returns a boolean if a field has been set. + +### SetStringProp + +`func (o *NullableClass) SetStringProp(v string)` + +SetStringProp gets a reference to the given string and assigns it to the StringProp field. + +### SetStringPropExplicitNull + +`func (o *NullableClass) SetStringPropExplicitNull(b bool)` + +SetStringPropExplicitNull (un)sets StringProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The StringProp value is set to nil even if false is passed +### GetDateProp + +`func (o *NullableClass) GetDateProp() string` + +GetDateProp returns the DateProp field if non-nil, zero value otherwise. + +### GetDatePropOk + +`func (o *NullableClass) GetDatePropOk() (string, bool)` + +GetDatePropOk returns a tuple with the DateProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDateProp + +`func (o *NullableClass) HasDateProp() bool` + +HasDateProp returns a boolean if a field has been set. + +### SetDateProp + +`func (o *NullableClass) SetDateProp(v string)` + +SetDateProp gets a reference to the given string and assigns it to the DateProp field. + +### SetDatePropExplicitNull + +`func (o *NullableClass) SetDatePropExplicitNull(b bool)` + +SetDatePropExplicitNull (un)sets DateProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The DateProp value is set to nil even if false is passed +### GetDatetimeProp + +`func (o *NullableClass) GetDatetimeProp() time.Time` + +GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. + +### GetDatetimePropOk + +`func (o *NullableClass) GetDatetimePropOk() (time.Time, bool)` + +GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasDatetimeProp + +`func (o *NullableClass) HasDatetimeProp() bool` + +HasDatetimeProp returns a boolean if a field has been set. + +### SetDatetimeProp + +`func (o *NullableClass) SetDatetimeProp(v time.Time)` + +SetDatetimeProp gets a reference to the given time.Time and assigns it to the DatetimeProp field. + +### SetDatetimePropExplicitNull + +`func (o *NullableClass) SetDatetimePropExplicitNull(b bool)` + +SetDatetimePropExplicitNull (un)sets DatetimeProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The DatetimeProp value is set to nil even if false is passed +### GetArrayNullableProp + +`func (o *NullableClass) GetArrayNullableProp() []map[string]interface{}` + +GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. + +### GetArrayNullablePropOk + +`func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool)` + +GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayNullableProp + +`func (o *NullableClass) HasArrayNullableProp() bool` + +HasArrayNullableProp returns a boolean if a field has been set. + +### SetArrayNullableProp + +`func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{})` + +SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. + +### SetArrayNullablePropExplicitNull + +`func (o *NullableClass) SetArrayNullablePropExplicitNull(b bool)` + +SetArrayNullablePropExplicitNull (un)sets ArrayNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ArrayNullableProp value is set to nil even if false is passed +### GetArrayAndItemsNullableProp + +`func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{}` + +GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. + +### GetArrayAndItemsNullablePropOk + +`func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]map[string]interface{}, bool)` + +GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayAndItemsNullableProp + +`func (o *NullableClass) HasArrayAndItemsNullableProp() bool` + +HasArrayAndItemsNullableProp returns a boolean if a field has been set. + +### SetArrayAndItemsNullableProp + +`func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{})` + +SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. + +### SetArrayAndItemsNullablePropExplicitNull + +`func (o *NullableClass) SetArrayAndItemsNullablePropExplicitNull(b bool)` + +SetArrayAndItemsNullablePropExplicitNull (un)sets ArrayAndItemsNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ArrayAndItemsNullableProp value is set to nil even if false is passed +### GetArrayItemsNullable + +`func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{}` + +GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. + +### GetArrayItemsNullableOk + +`func (o *NullableClass) GetArrayItemsNullableOk() ([]map[string]interface{}, bool)` + +GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasArrayItemsNullable + +`func (o *NullableClass) HasArrayItemsNullable() bool` + +HasArrayItemsNullable returns a boolean if a field has been set. + +### SetArrayItemsNullable + +`func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{})` + +SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. + +### GetObjectNullableProp + +`func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{}` + +GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. + +### GetObjectNullablePropOk + +`func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool)` + +GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasObjectNullableProp + +`func (o *NullableClass) HasObjectNullableProp() bool` + +HasObjectNullableProp returns a boolean if a field has been set. + +### SetObjectNullableProp + +`func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{})` + +SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. + +### SetObjectNullablePropExplicitNull + +`func (o *NullableClass) SetObjectNullablePropExplicitNull(b bool)` + +SetObjectNullablePropExplicitNull (un)sets ObjectNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ObjectNullableProp value is set to nil even if false is passed +### GetObjectAndItemsNullableProp + +`func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{}` + +GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. + +### GetObjectAndItemsNullablePropOk + +`func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool)` + +GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasObjectAndItemsNullableProp + +`func (o *NullableClass) HasObjectAndItemsNullableProp() bool` + +HasObjectAndItemsNullableProp returns a boolean if a field has been set. + +### SetObjectAndItemsNullableProp + +`func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{})` + +SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. + +### SetObjectAndItemsNullablePropExplicitNull + +`func (o *NullableClass) SetObjectAndItemsNullablePropExplicitNull(b bool)` + +SetObjectAndItemsNullablePropExplicitNull (un)sets ObjectAndItemsNullableProp to be considered as explicit "null" value +when serializing to JSON (pass true as argument to set this, false to unset) +The ObjectAndItemsNullableProp value is set to nil even if false is passed +### GetObjectItemsNullable + +`func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{}` + +GetObjectItemsNullable returns the ObjectItemsNullable field if non-nil, zero value otherwise. + +### GetObjectItemsNullableOk + +`func (o *NullableClass) GetObjectItemsNullableOk() (map[string]map[string]interface{}, bool)` + +GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasObjectItemsNullable + +`func (o *NullableClass) HasObjectItemsNullable() bool` + +HasObjectItemsNullable returns a boolean if a field has been set. + +### SetObjectItemsNullable + +`func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{})` + +SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md new file mode 100644 index 00000000000..c8dcac264c2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/NumberOnly.md @@ -0,0 +1,39 @@ +# NumberOnly + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**JustNumber** | Pointer to **float32** | | [optional] + +## Methods + +### GetJustNumber + +`func (o *NumberOnly) GetJustNumber() float32` + +GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. + +### GetJustNumberOk + +`func (o *NumberOnly) GetJustNumberOk() (float32, bool)` + +GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasJustNumber + +`func (o *NumberOnly) HasJustNumber() bool` + +HasJustNumber returns a boolean if a field has been set. + +### SetJustNumber + +`func (o *NumberOnly) SetJustNumber(v float32)` + +SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md new file mode 100644 index 00000000000..8aa8bbd1ee5 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Order.md @@ -0,0 +1,169 @@ +# Order + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**PetId** | Pointer to **int64** | | [optional] +**Quantity** | Pointer to **int32** | | [optional] +**ShipDate** | Pointer to [**time.Time**](time.Time.md) | | [optional] +**Status** | Pointer to **string** | Order Status | [optional] +**Complete** | Pointer to **bool** | | [optional] [default to false] + +## Methods + +### GetId + +`func (o *Order) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Order) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Order) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Order) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetPetId + +`func (o *Order) GetPetId() int64` + +GetPetId returns the PetId field if non-nil, zero value otherwise. + +### GetPetIdOk + +`func (o *Order) GetPetIdOk() (int64, bool)` + +GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPetId + +`func (o *Order) HasPetId() bool` + +HasPetId returns a boolean if a field has been set. + +### SetPetId + +`func (o *Order) SetPetId(v int64)` + +SetPetId gets a reference to the given int64 and assigns it to the PetId field. + +### GetQuantity + +`func (o *Order) GetQuantity() int32` + +GetQuantity returns the Quantity field if non-nil, zero value otherwise. + +### GetQuantityOk + +`func (o *Order) GetQuantityOk() (int32, bool)` + +GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasQuantity + +`func (o *Order) HasQuantity() bool` + +HasQuantity returns a boolean if a field has been set. + +### SetQuantity + +`func (o *Order) SetQuantity(v int32)` + +SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. + +### GetShipDate + +`func (o *Order) GetShipDate() time.Time` + +GetShipDate returns the ShipDate field if non-nil, zero value otherwise. + +### GetShipDateOk + +`func (o *Order) GetShipDateOk() (time.Time, bool)` + +GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasShipDate + +`func (o *Order) HasShipDate() bool` + +HasShipDate returns a boolean if a field has been set. + +### SetShipDate + +`func (o *Order) SetShipDate(v time.Time)` + +SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. + +### GetStatus + +`func (o *Order) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Order) GetStatusOk() (string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStatus + +`func (o *Order) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatus + +`func (o *Order) SetStatus(v string)` + +SetStatus gets a reference to the given string and assigns it to the Status field. + +### GetComplete + +`func (o *Order) GetComplete() bool` + +GetComplete returns the Complete field if non-nil, zero value otherwise. + +### GetCompleteOk + +`func (o *Order) GetCompleteOk() (bool, bool)` + +GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasComplete + +`func (o *Order) HasComplete() bool` + +HasComplete returns a boolean if a field has been set. + +### SetComplete + +`func (o *Order) SetComplete(v bool)` + +SetComplete gets a reference to the given bool and assigns it to the Complete field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md new file mode 100644 index 00000000000..f8908022282 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterComposite.md @@ -0,0 +1,91 @@ +# OuterComposite + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**MyNumber** | Pointer to **float32** | | [optional] +**MyString** | Pointer to **string** | | [optional] +**MyBoolean** | Pointer to **bool** | | [optional] + +## Methods + +### GetMyNumber + +`func (o *OuterComposite) GetMyNumber() float32` + +GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. + +### GetMyNumberOk + +`func (o *OuterComposite) GetMyNumberOk() (float32, bool)` + +GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMyNumber + +`func (o *OuterComposite) HasMyNumber() bool` + +HasMyNumber returns a boolean if a field has been set. + +### SetMyNumber + +`func (o *OuterComposite) SetMyNumber(v float32)` + +SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. + +### GetMyString + +`func (o *OuterComposite) GetMyString() string` + +GetMyString returns the MyString field if non-nil, zero value otherwise. + +### GetMyStringOk + +`func (o *OuterComposite) GetMyStringOk() (string, bool)` + +GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMyString + +`func (o *OuterComposite) HasMyString() bool` + +HasMyString returns a boolean if a field has been set. + +### SetMyString + +`func (o *OuterComposite) SetMyString(v string)` + +SetMyString gets a reference to the given string and assigns it to the MyString field. + +### GetMyBoolean + +`func (o *OuterComposite) GetMyBoolean() bool` + +GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. + +### GetMyBooleanOk + +`func (o *OuterComposite) GetMyBooleanOk() (bool, bool)` + +GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasMyBoolean + +`func (o *OuterComposite) HasMyBoolean() bool` + +HasMyBoolean returns a boolean if a field has been set. + +### SetMyBoolean + +`func (o *OuterComposite) SetMyBoolean(v bool)` + +SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md new file mode 100644 index 00000000000..13bed2d17fd --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnum.md @@ -0,0 +1,11 @@ +# OuterEnum + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md new file mode 100644 index 00000000000..50f8ab0096c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumDefaultValue.md @@ -0,0 +1,11 @@ +# OuterEnumDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md new file mode 100644 index 00000000000..eb033db7cc5 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumInteger.md @@ -0,0 +1,11 @@ +# OuterEnumInteger + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md new file mode 100644 index 00000000000..7a163432954 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/OuterEnumIntegerDefaultValue.md @@ -0,0 +1,11 @@ +# OuterEnumIntegerDefaultValue + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md new file mode 100644 index 00000000000..dba9589f9d7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Pet.md @@ -0,0 +1,169 @@ +# Pet + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Category** | Pointer to [**Category**](Category.md) | | [optional] +**Name** | Pointer to **string** | | +**PhotoUrls** | Pointer to **[]string** | | +**Tags** | Pointer to [**[]Tag**](Tag.md) | | [optional] +**Status** | Pointer to **string** | pet status in the store | [optional] + +## Methods + +### GetId + +`func (o *Pet) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Pet) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Pet) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Pet) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetCategory + +`func (o *Pet) GetCategory() Category` + +GetCategory returns the Category field if non-nil, zero value otherwise. + +### GetCategoryOk + +`func (o *Pet) GetCategoryOk() (Category, bool)` + +GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasCategory + +`func (o *Pet) HasCategory() bool` + +HasCategory returns a boolean if a field has been set. + +### SetCategory + +`func (o *Pet) SetCategory(v Category)` + +SetCategory gets a reference to the given Category and assigns it to the Category field. + +### GetName + +`func (o *Pet) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Pet) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Pet) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Pet) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + +### GetPhotoUrls + +`func (o *Pet) GetPhotoUrls() []string` + +GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. + +### GetPhotoUrlsOk + +`func (o *Pet) GetPhotoUrlsOk() ([]string, bool)` + +GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPhotoUrls + +`func (o *Pet) HasPhotoUrls() bool` + +HasPhotoUrls returns a boolean if a field has been set. + +### SetPhotoUrls + +`func (o *Pet) SetPhotoUrls(v []string)` + +SetPhotoUrls gets a reference to the given []string and assigns it to the PhotoUrls field. + +### GetTags + +`func (o *Pet) GetTags() []Tag` + +GetTags returns the Tags field if non-nil, zero value otherwise. + +### GetTagsOk + +`func (o *Pet) GetTagsOk() ([]Tag, bool)` + +GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasTags + +`func (o *Pet) HasTags() bool` + +HasTags returns a boolean if a field has been set. + +### SetTags + +`func (o *Pet) SetTags(v []Tag)` + +SetTags gets a reference to the given []Tag and assigns it to the Tags field. + +### GetStatus + +`func (o *Pet) GetStatus() string` + +GetStatus returns the Status field if non-nil, zero value otherwise. + +### GetStatusOk + +`func (o *Pet) GetStatusOk() (string, bool)` + +GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasStatus + +`func (o *Pet) HasStatus() bool` + +HasStatus returns a boolean if a field has been set. + +### SetStatus + +`func (o *Pet) SetStatus(v string)` + +SetStatus gets a reference to the given string and assigns it to the Status field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md new file mode 100644 index 00000000000..c4f37589f0c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/PetApi.md @@ -0,0 +1,350 @@ +# \PetApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AddPet**](PetApi.md#AddPet) | **Post** /pet | Add a new pet to the store +[**DeletePet**](PetApi.md#DeletePet) | **Delete** /pet/{petId} | Deletes a pet +[**FindPetsByStatus**](PetApi.md#FindPetsByStatus) | **Get** /pet/findByStatus | Finds Pets by status +[**FindPetsByTags**](PetApi.md#FindPetsByTags) | **Get** /pet/findByTags | Finds Pets by tags +[**GetPetById**](PetApi.md#GetPetById) | **Get** /pet/{petId} | Find pet by ID +[**UpdatePet**](PetApi.md#UpdatePet) | **Put** /pet | Update an existing pet +[**UpdatePetWithForm**](PetApi.md#UpdatePetWithForm) | **Post** /pet/{petId} | Updates a pet in the store with form data +[**UploadFile**](PetApi.md#UploadFile) | **Post** /pet/{petId}/uploadImage | uploads an image +[**UploadFileWithRequiredFile**](PetApi.md#UploadFileWithRequiredFile) | **Post** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required) + + + +## AddPet + +> 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. +**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **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) + + +## DeletePet + +> DeletePet(ctx, petId, optional) +Deletes a pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| Pet id to delete | + **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a DeletePetOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **apiKey** | **optional.String**| | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## FindPetsByStatus + +> []Pet FindPetsByStatus(ctx, status) +Finds Pets by status + +Multiple status values can be provided with comma separated strings + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**status** | [**[]string**](string.md)| Status values that need to be considered for filter | + +### Return type + +[**[]Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[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) + + +## FindPetsByTags + +> []Pet FindPetsByTags(ctx, tags) +Finds Pets by tags + +Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**tags** | [**[]string**](string.md)| Tags to filter by | + +### Return type + +[**[]Pet**](Pet.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[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) + + +## GetPetById + +> Pet GetPetById(ctx, petId) +Find pet by ID + +Returns a single pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet to return | + +### Return type + +[**Pet**](Pet.md) + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[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, pet) +Update an existing pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: application/json, application/xml +- **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) + + +## UpdatePetWithForm + +> UpdatePetWithForm(ctx, petId, optional) +Updates a pet in the store with form data + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet that needs to be updated | + **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **name** | **optional.String**| Updated name of the pet | + **status** | **optional.String**| Updated status of the pet | + +### Return type + + (empty response body) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **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) + + +## UploadFile + +> ApiResponse UploadFile(ctx, petId, optional) +uploads an image + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet to update | + **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UploadFileOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **additionalMetadata** | **optional.String**| Additional data to pass to server | + **file** | **optional.Interface of *os.File****optional.*os.File**| file to upload | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[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, requiredFile, optional) +uploads an image (required) + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**petId** | **int64**| ID of pet to update | +**requiredFile** | ***os.File*****os.File**| file to upload | + **optional** | ***UploadFileWithRequiredFileOpts** | optional parameters | nil if no parameters + +### Optional Parameters + +Optional parameters are passed through a pointer to a UploadFileWithRequiredFileOpts struct + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **additionalMetadata** | **optional.String**| Additional data to pass to server | + +### Return type + +[**ApiResponse**](ApiResponse.md) + +### Authorization + +[petstore_auth](../README.md#petstore_auth) + +### HTTP request headers + +- **Content-Type**: multipart/form-data +- **Accept**: application/json + +[[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) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md new file mode 100644 index 00000000000..552f0170bd8 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/ReadOnlyFirst.md @@ -0,0 +1,65 @@ +# ReadOnlyFirst + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bar** | Pointer to **string** | | [optional] +**Baz** | Pointer to **string** | | [optional] + +## Methods + +### GetBar + +`func (o *ReadOnlyFirst) GetBar() string` + +GetBar returns the Bar field if non-nil, zero value otherwise. + +### GetBarOk + +`func (o *ReadOnlyFirst) GetBarOk() (string, bool)` + +GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBar + +`func (o *ReadOnlyFirst) HasBar() bool` + +HasBar returns a boolean if a field has been set. + +### SetBar + +`func (o *ReadOnlyFirst) SetBar(v string)` + +SetBar gets a reference to the given string and assigns it to the Bar field. + +### GetBaz + +`func (o *ReadOnlyFirst) GetBaz() string` + +GetBaz returns the Baz field if non-nil, zero value otherwise. + +### GetBazOk + +`func (o *ReadOnlyFirst) GetBazOk() (string, bool)` + +GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasBaz + +`func (o *ReadOnlyFirst) HasBaz() bool` + +HasBaz returns a boolean if a field has been set. + +### SetBaz + +`func (o *ReadOnlyFirst) SetBaz(v string)` + +SetBaz gets a reference to the given string and assigns it to the Baz field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md new file mode 100644 index 00000000000..1facabb6bbf --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Return.md @@ -0,0 +1,39 @@ +# Return + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Return** | Pointer to **int32** | | [optional] + +## Methods + +### GetReturn + +`func (o *Return) GetReturn() int32` + +GetReturn returns the Return field if non-nil, zero value otherwise. + +### GetReturnOk + +`func (o *Return) GetReturnOk() (int32, bool)` + +GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasReturn + +`func (o *Return) HasReturn() bool` + +HasReturn returns a boolean if a field has been set. + +### SetReturn + +`func (o *Return) SetReturn(v int32)` + +SetReturn gets a reference to the given int32 and assigns it to the Return field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md new file mode 100644 index 00000000000..34d8d8d89c7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/SpecialModelName.md @@ -0,0 +1,39 @@ +# SpecialModelName + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SpecialPropertyName** | Pointer to **int64** | | [optional] + +## Methods + +### GetSpecialPropertyName + +`func (o *SpecialModelName) GetSpecialPropertyName() int64` + +GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. + +### GetSpecialPropertyNameOk + +`func (o *SpecialModelName) GetSpecialPropertyNameOk() (int64, bool)` + +GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasSpecialPropertyName + +`func (o *SpecialModelName) HasSpecialPropertyName() bool` + +HasSpecialPropertyName returns a boolean if a field has been set. + +### SetSpecialPropertyName + +`func (o *SpecialModelName) SetSpecialPropertyName(v int64)` + +SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md new file mode 100644 index 00000000000..c7f9bbcee08 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/StoreApi.md @@ -0,0 +1,138 @@ +# \StoreApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DeleteOrder**](StoreApi.md#DeleteOrder) | **Delete** /store/order/{order_id} | Delete purchase order by ID +[**GetInventory**](StoreApi.md#GetInventory) | **Get** /store/inventory | Returns pet inventories by status +[**GetOrderById**](StoreApi.md#GetOrderById) | **Get** /store/order/{order_id} | Find purchase order by ID +[**PlaceOrder**](StoreApi.md#PlaceOrder) | **Post** /store/order | Place an order for a pet + + + +## DeleteOrder + +> DeleteOrder(ctx, orderId) +Delete purchase order by ID + +For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orderId** | **string**| ID of the order that needs to be deleted | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetInventory + +> map[string]int32 GetInventory(ctx, ) +Returns pet inventories by status + +Returns a map of status codes to quantities + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + +**map[string]int32** + +### Authorization + +[api_key](../README.md#api_key) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[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) + + +## GetOrderById + +> Order GetOrderById(ctx, orderId) +Find purchase order by ID + +For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**orderId** | **int64**| ID of pet that needs to be fetched | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[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, order) +Place an order for a pet + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**order** | [**Order**](Order.md)| order placed for purchasing the pet | + +### Return type + +[**Order**](Order.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/xml, application/json + +[[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) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md new file mode 100644 index 00000000000..bf868298a5e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/Tag.md @@ -0,0 +1,65 @@ +# Tag + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Name** | Pointer to **string** | | [optional] + +## Methods + +### GetId + +`func (o *Tag) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *Tag) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *Tag) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *Tag) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetName + +`func (o *Tag) GetName() string` + +GetName returns the Name field if non-nil, zero value otherwise. + +### GetNameOk + +`func (o *Tag) GetNameOk() (string, bool)` + +GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasName + +`func (o *Tag) HasName() bool` + +HasName returns a boolean if a field has been set. + +### SetName + +`func (o *Tag) SetName(v string)` + +SetName gets a reference to the given string and assigns it to the Name field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md new file mode 100644 index 00000000000..8b93a65d8ab --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/User.md @@ -0,0 +1,221 @@ +# User + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | Pointer to **int64** | | [optional] +**Username** | Pointer to **string** | | [optional] +**FirstName** | Pointer to **string** | | [optional] +**LastName** | Pointer to **string** | | [optional] +**Email** | Pointer to **string** | | [optional] +**Password** | Pointer to **string** | | [optional] +**Phone** | Pointer to **string** | | [optional] +**UserStatus** | Pointer to **int32** | User Status | [optional] + +## Methods + +### GetId + +`func (o *User) GetId() int64` + +GetId returns the Id field if non-nil, zero value otherwise. + +### GetIdOk + +`func (o *User) GetIdOk() (int64, bool)` + +GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasId + +`func (o *User) HasId() bool` + +HasId returns a boolean if a field has been set. + +### SetId + +`func (o *User) SetId(v int64)` + +SetId gets a reference to the given int64 and assigns it to the Id field. + +### GetUsername + +`func (o *User) GetUsername() string` + +GetUsername returns the Username field if non-nil, zero value otherwise. + +### GetUsernameOk + +`func (o *User) GetUsernameOk() (string, bool)` + +GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUsername + +`func (o *User) HasUsername() bool` + +HasUsername returns a boolean if a field has been set. + +### SetUsername + +`func (o *User) SetUsername(v string)` + +SetUsername gets a reference to the given string and assigns it to the Username field. + +### GetFirstName + +`func (o *User) GetFirstName() string` + +GetFirstName returns the FirstName field if non-nil, zero value otherwise. + +### GetFirstNameOk + +`func (o *User) GetFirstNameOk() (string, bool)` + +GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasFirstName + +`func (o *User) HasFirstName() bool` + +HasFirstName returns a boolean if a field has been set. + +### SetFirstName + +`func (o *User) SetFirstName(v string)` + +SetFirstName gets a reference to the given string and assigns it to the FirstName field. + +### GetLastName + +`func (o *User) GetLastName() string` + +GetLastName returns the LastName field if non-nil, zero value otherwise. + +### GetLastNameOk + +`func (o *User) GetLastNameOk() (string, bool)` + +GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasLastName + +`func (o *User) HasLastName() bool` + +HasLastName returns a boolean if a field has been set. + +### SetLastName + +`func (o *User) SetLastName(v string)` + +SetLastName gets a reference to the given string and assigns it to the LastName field. + +### GetEmail + +`func (o *User) GetEmail() string` + +GetEmail returns the Email field if non-nil, zero value otherwise. + +### GetEmailOk + +`func (o *User) GetEmailOk() (string, bool)` + +GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasEmail + +`func (o *User) HasEmail() bool` + +HasEmail returns a boolean if a field has been set. + +### SetEmail + +`func (o *User) SetEmail(v string)` + +SetEmail gets a reference to the given string and assigns it to the Email field. + +### GetPassword + +`func (o *User) GetPassword() string` + +GetPassword returns the Password field if non-nil, zero value otherwise. + +### GetPasswordOk + +`func (o *User) GetPasswordOk() (string, bool)` + +GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPassword + +`func (o *User) HasPassword() bool` + +HasPassword returns a boolean if a field has been set. + +### SetPassword + +`func (o *User) SetPassword(v string)` + +SetPassword gets a reference to the given string and assigns it to the Password field. + +### GetPhone + +`func (o *User) GetPhone() string` + +GetPhone returns the Phone field if non-nil, zero value otherwise. + +### GetPhoneOk + +`func (o *User) GetPhoneOk() (string, bool)` + +GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasPhone + +`func (o *User) HasPhone() bool` + +HasPhone returns a boolean if a field has been set. + +### SetPhone + +`func (o *User) SetPhone(v string)` + +SetPhone gets a reference to the given string and assigns it to the Phone field. + +### GetUserStatus + +`func (o *User) GetUserStatus() int32` + +GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. + +### GetUserStatusOk + +`func (o *User) GetUserStatusOk() (int32, bool)` + +GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### HasUserStatus + +`func (o *User) HasUserStatus() bool` + +HasUserStatus returns a boolean if a field has been set. + +### SetUserStatus + +`func (o *User) SetUserStatus(v int32)` + +SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md new file mode 100644 index 00000000000..6c443592e53 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/docs/UserApi.md @@ -0,0 +1,268 @@ +# \UserApi + +All URIs are relative to *http://petstore.swagger.io:80/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CreateUser**](UserApi.md#CreateUser) | **Post** /user | Create user +[**CreateUsersWithArrayInput**](UserApi.md#CreateUsersWithArrayInput) | **Post** /user/createWithArray | Creates list of users with given input array +[**CreateUsersWithListInput**](UserApi.md#CreateUsersWithListInput) | **Post** /user/createWithList | Creates list of users with given input array +[**DeleteUser**](UserApi.md#DeleteUser) | **Delete** /user/{username} | Delete user +[**GetUserByName**](UserApi.md#GetUserByName) | **Get** /user/{username} | Get user by user name +[**LoginUser**](UserApi.md#LoginUser) | **Get** /user/login | Logs user into the system +[**LogoutUser**](UserApi.md#LogoutUser) | **Get** /user/logout | Logs out current logged in user session +[**UpdateUser**](UserApi.md#UpdateUser) | **Put** /user/{username} | Updated user + + + +## CreateUser + +> CreateUser(ctx, user) +Create user + +This can only be done by the logged in user. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**user** | [**User**](User.md)| Created user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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, 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. +**user** | [**[]User**](User.md)| List of user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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, 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. +**user** | [**[]User**](User.md)| List of user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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) + + +## DeleteUser + +> DeleteUser(ctx, username) +Delete user + +This can only be done by the logged in user. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| The name that needs to be deleted | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## GetUserByName + +> User GetUserByName(ctx, username) +Get user by user name + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| The name that needs to be fetched. Use user1 for testing. | + +### Return type + +[**User**](User.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[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) + + +## LoginUser + +> string LoginUser(ctx, username, password) +Logs user into the system + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| The user name for login | +**password** | **string**| The password for login in clear text | + +### Return type + +**string** + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/xml, application/json + +[[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) + + +## LogoutUser + +> LogoutUser(ctx, ) +Logs out current logged in user session + +### Required Parameters + +This endpoint does not need any parameter. + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) +[[Back to Model list]](../README.md#documentation-for-models) +[[Back to README]](../README.md) + + +## UpdateUser + +> UpdateUser(ctx, username, user) +Updated user + +This can only be done by the logged in user. + +### Required Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- +**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. +**username** | **string**| name that need to be deleted | +**user** | [**User**](User.md)| Updated user object | + +### Return type + + (empty response body) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: 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) + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh b/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh new file mode 100644 index 00000000000..ced3be2b0c7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/git_push.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=`git remote` +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod new file mode 100644 index 00000000000..199809ed706 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.mod @@ -0,0 +1,6 @@ +module github.com/GIT_USER_ID/GIT_REPO_ID + +require ( + github.com/antihax/optional v0.0.0-20180406194304-ca021399b1a6 + golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a +) diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum new file mode 100644 index 00000000000..e3c16fef3ac --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/go.sum @@ -0,0 +1,11 @@ +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/antihax/optional v0.0.0-20180406194304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e h1:bRhVy7zSSasaqNksaRZiA5EEI+Ei4I1nO5Jh72wfHlg= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a h1:tImsplftrFpALCYumobsd0K86vlAs/eXGFms2txfJfA= +golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go new file mode 100644 index 00000000000..236aca8ee39 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_200_response.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// Model200Response Model for testing model name starting with number +type Model200Response struct { + Name *int32 `json:"name,omitempty"` + + Class *string `json:"class,omitempty"` + +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Model200Response) GetName() int32 { + if o == nil || o.Name == nil { + var ret int32 + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetNameOk() (int32, bool) { + if o == nil || o.Name == nil { + var ret int32 + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Model200Response) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given int32 and assigns it to the Name field. +func (o *Model200Response) SetName(v int32) { + o.Name = &v +} + +// GetClass returns the Class field if non-nil, zero value otherwise. +func (o *Model200Response) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Model200Response) GetClassOk() (string, bool) { + if o == nil || o.Class == nil { + var ret string + return ret, false + } + return *o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *Model200Response) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *Model200Response) SetClass(v string) { + o.Class = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Model200Response) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Class != nil { + toSerialize["class"] = o.Class + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go new file mode 100644 index 00000000000..9c2435fa146 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model__special_model_name_.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// SpecialModelName struct for SpecialModelName +type SpecialModelName struct { + SpecialPropertyName *int64 `json:"$special[property.name],omitempty"` + +} + +// GetSpecialPropertyName returns the SpecialPropertyName field if non-nil, zero value otherwise. +func (o *SpecialModelName) GetSpecialPropertyName() int64 { + if o == nil || o.SpecialPropertyName == nil { + var ret int64 + return ret + } + return *o.SpecialPropertyName +} + +// GetSpecialPropertyNameOk returns a tuple with the SpecialPropertyName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *SpecialModelName) GetSpecialPropertyNameOk() (int64, bool) { + if o == nil || o.SpecialPropertyName == nil { + var ret int64 + return ret, false + } + return *o.SpecialPropertyName, true +} + +// HasSpecialPropertyName returns a boolean if a field has been set. +func (o *SpecialModelName) HasSpecialPropertyName() bool { + if o != nil && o.SpecialPropertyName != nil { + return true + } + + return false +} + +// SetSpecialPropertyName gets a reference to the given int64 and assigns it to the SpecialPropertyName field. +func (o *SpecialModelName) SetSpecialPropertyName(v int64) { + o.SpecialPropertyName = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o SpecialModelName) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SpecialPropertyName != nil { + toSerialize["$special[property.name]"] = o.SpecialPropertyName + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go new file mode 100644 index 00000000000..a4050e424c3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_additional_properties_class.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// AdditionalPropertiesClass struct for AdditionalPropertiesClass +type AdditionalPropertiesClass struct { + MapProperty *map[string]string `json:"map_property,omitempty"` + + MapOfMapProperty *map[string]map[string]string `json:"map_of_map_property,omitempty"` + +} + +// GetMapProperty returns the MapProperty field if non-nil, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapProperty() map[string]string { + if o == nil || o.MapProperty == nil { + var ret map[string]string + return ret + } + return *o.MapProperty +} + +// GetMapPropertyOk returns a tuple with the MapProperty field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapPropertyOk() (map[string]string, bool) { + if o == nil || o.MapProperty == nil { + var ret map[string]string + return ret, false + } + return *o.MapProperty, true +} + +// HasMapProperty returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapProperty() bool { + if o != nil && o.MapProperty != nil { + return true + } + + return false +} + +// SetMapProperty gets a reference to the given map[string]string and assigns it to the MapProperty field. +func (o *AdditionalPropertiesClass) SetMapProperty(v map[string]string) { + o.MapProperty = &v +} + +// GetMapOfMapProperty returns the MapOfMapProperty field if non-nil, zero value otherwise. +func (o *AdditionalPropertiesClass) GetMapOfMapProperty() map[string]map[string]string { + if o == nil || o.MapOfMapProperty == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapOfMapProperty +} + +// GetMapOfMapPropertyOk returns a tuple with the MapOfMapProperty field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *AdditionalPropertiesClass) GetMapOfMapPropertyOk() (map[string]map[string]string, bool) { + if o == nil || o.MapOfMapProperty == nil { + var ret map[string]map[string]string + return ret, false + } + return *o.MapOfMapProperty, true +} + +// HasMapOfMapProperty returns a boolean if a field has been set. +func (o *AdditionalPropertiesClass) HasMapOfMapProperty() bool { + if o != nil && o.MapOfMapProperty != nil { + return true + } + + return false +} + +// SetMapOfMapProperty gets a reference to the given map[string]map[string]string and assigns it to the MapOfMapProperty field. +func (o *AdditionalPropertiesClass) SetMapOfMapProperty(v map[string]map[string]string) { + o.MapOfMapProperty = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o AdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapProperty != nil { + toSerialize["map_property"] = o.MapProperty + } + if o.MapOfMapProperty != nil { + toSerialize["map_of_map_property"] = o.MapOfMapProperty + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go new file mode 100644 index 00000000000..472ed9a093e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_animal.go @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// Animal struct for Animal +type Animal struct { + ClassName *string `json:"className,omitempty"` + + Color *string `json:"color,omitempty"` + +} + +// GetClassName returns the ClassName field if non-nil, zero value otherwise. +func (o *Animal) GetClassName() string { + if o == nil || o.ClassName == nil { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Animal) GetClassNameOk() (string, bool) { + if o == nil || o.ClassName == nil { + var ret string + return ret, false + } + return *o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Animal) HasClassName() bool { + if o != nil && o.ClassName != nil { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Animal) SetClassName(v string) { + o.ClassName = &v +} + +// GetColor returns the Color field if non-nil, zero value otherwise. +func (o *Animal) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Animal) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Animal) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Animal) SetColor(v string) { + o.Color = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Animal) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClassName == nil { + return nil, errors.New("ClassName is required and not nullable, but was not set on Animal") + } + if o.ClassName != nil { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go new file mode 100644 index 00000000000..6ef9d8e9da9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_api_response.go @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// ApiResponse struct for ApiResponse +type ApiResponse struct { + Code *int32 `json:"code,omitempty"` + + Type *string `json:"type,omitempty"` + + Message *string `json:"message,omitempty"` + +} + +// GetCode returns the Code field if non-nil, zero value otherwise. +func (o *ApiResponse) GetCode() int32 { + if o == nil || o.Code == nil { + var ret int32 + return ret + } + return *o.Code +} + +// GetCodeOk returns a tuple with the Code field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetCodeOk() (int32, bool) { + if o == nil || o.Code == nil { + var ret int32 + return ret, false + } + return *o.Code, true +} + +// HasCode returns a boolean if a field has been set. +func (o *ApiResponse) HasCode() bool { + if o != nil && o.Code != nil { + return true + } + + return false +} + +// SetCode gets a reference to the given int32 and assigns it to the Code field. +func (o *ApiResponse) SetCode(v int32) { + o.Code = &v +} + +// GetType returns the Type field if non-nil, zero value otherwise. +func (o *ApiResponse) GetType() string { + if o == nil || o.Type == nil { + var ret string + return ret + } + return *o.Type +} + +// GetTypeOk returns a tuple with the Type field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetTypeOk() (string, bool) { + if o == nil || o.Type == nil { + var ret string + return ret, false + } + return *o.Type, true +} + +// HasType returns a boolean if a field has been set. +func (o *ApiResponse) HasType() bool { + if o != nil && o.Type != nil { + return true + } + + return false +} + +// SetType gets a reference to the given string and assigns it to the Type field. +func (o *ApiResponse) SetType(v string) { + o.Type = &v +} + +// GetMessage returns the Message field if non-nil, zero value otherwise. +func (o *ApiResponse) GetMessage() string { + if o == nil || o.Message == nil { + var ret string + return ret + } + return *o.Message +} + +// GetMessageOk returns a tuple with the Message field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ApiResponse) GetMessageOk() (string, bool) { + if o == nil || o.Message == nil { + var ret string + return ret, false + } + return *o.Message, true +} + +// HasMessage returns a boolean if a field has been set. +func (o *ApiResponse) HasMessage() bool { + if o != nil && o.Message != nil { + return true + } + + return false +} + +// SetMessage gets a reference to the given string and assigns it to the Message field. +func (o *ApiResponse) SetMessage(v string) { + o.Message = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o ApiResponse) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Code != nil { + toSerialize["code"] = o.Code + } + if o.Type != nil { + toSerialize["type"] = o.Type + } + if o.Message != nil { + toSerialize["message"] = o.Message + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go new file mode 100644 index 00000000000..72f26371671 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_array_of_number_only.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// ArrayOfArrayOfNumberOnly struct for ArrayOfArrayOfNumberOnly +type ArrayOfArrayOfNumberOnly struct { + ArrayArrayNumber *[][]float32 `json:"ArrayArrayNumber,omitempty"` + +} + +// GetArrayArrayNumber returns the ArrayArrayNumber field if non-nil, zero value otherwise. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumber() [][]float32 { + if o == nil || o.ArrayArrayNumber == nil { + var ret [][]float32 + return ret + } + return *o.ArrayArrayNumber +} + +// GetArrayArrayNumberOk returns a tuple with the ArrayArrayNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfArrayOfNumberOnly) GetArrayArrayNumberOk() ([][]float32, bool) { + if o == nil || o.ArrayArrayNumber == nil { + var ret [][]float32 + return ret, false + } + return *o.ArrayArrayNumber, true +} + +// HasArrayArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfArrayOfNumberOnly) HasArrayArrayNumber() bool { + if o != nil && o.ArrayArrayNumber != nil { + return true + } + + return false +} + +// SetArrayArrayNumber gets a reference to the given [][]float32 and assigns it to the ArrayArrayNumber field. +func (o *ArrayOfArrayOfNumberOnly) SetArrayArrayNumber(v [][]float32) { + o.ArrayArrayNumber = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o ArrayOfArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayArrayNumber != nil { + toSerialize["ArrayArrayNumber"] = o.ArrayArrayNumber + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go new file mode 100644 index 00000000000..595caf5c351 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_of_number_only.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// ArrayOfNumberOnly struct for ArrayOfNumberOnly +type ArrayOfNumberOnly struct { + ArrayNumber *[]float32 `json:"ArrayNumber,omitempty"` + +} + +// GetArrayNumber returns the ArrayNumber field if non-nil, zero value otherwise. +func (o *ArrayOfNumberOnly) GetArrayNumber() []float32 { + if o == nil || o.ArrayNumber == nil { + var ret []float32 + return ret + } + return *o.ArrayNumber +} + +// GetArrayNumberOk returns a tuple with the ArrayNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayOfNumberOnly) GetArrayNumberOk() ([]float32, bool) { + if o == nil || o.ArrayNumber == nil { + var ret []float32 + return ret, false + } + return *o.ArrayNumber, true +} + +// HasArrayNumber returns a boolean if a field has been set. +func (o *ArrayOfNumberOnly) HasArrayNumber() bool { + if o != nil && o.ArrayNumber != nil { + return true + } + + return false +} + +// SetArrayNumber gets a reference to the given []float32 and assigns it to the ArrayNumber field. +func (o *ArrayOfNumberOnly) SetArrayNumber(v []float32) { + o.ArrayNumber = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o ArrayOfNumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayNumber != nil { + toSerialize["ArrayNumber"] = o.ArrayNumber + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go new file mode 100644 index 00000000000..fe8729cc1de --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_array_test_.go @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// ArrayTest struct for ArrayTest +type ArrayTest struct { + ArrayOfString *[]string `json:"array_of_string,omitempty"` + + ArrayArrayOfInteger *[][]int64 `json:"array_array_of_integer,omitempty"` + + ArrayArrayOfModel *[][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` + +} + +// GetArrayOfString returns the ArrayOfString field if non-nil, zero value otherwise. +func (o *ArrayTest) GetArrayOfString() []string { + if o == nil || o.ArrayOfString == nil { + var ret []string + return ret + } + return *o.ArrayOfString +} + +// GetArrayOfStringOk returns a tuple with the ArrayOfString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayOfStringOk() ([]string, bool) { + if o == nil || o.ArrayOfString == nil { + var ret []string + return ret, false + } + return *o.ArrayOfString, true +} + +// HasArrayOfString returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayOfString() bool { + if o != nil && o.ArrayOfString != nil { + return true + } + + return false +} + +// SetArrayOfString gets a reference to the given []string and assigns it to the ArrayOfString field. +func (o *ArrayTest) SetArrayOfString(v []string) { + o.ArrayOfString = &v +} + +// GetArrayArrayOfInteger returns the ArrayArrayOfInteger field if non-nil, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfInteger() [][]int64 { + if o == nil || o.ArrayArrayOfInteger == nil { + var ret [][]int64 + return ret + } + return *o.ArrayArrayOfInteger +} + +// GetArrayArrayOfIntegerOk returns a tuple with the ArrayArrayOfInteger field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfIntegerOk() ([][]int64, bool) { + if o == nil || o.ArrayArrayOfInteger == nil { + var ret [][]int64 + return ret, false + } + return *o.ArrayArrayOfInteger, true +} + +// HasArrayArrayOfInteger returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfInteger() bool { + if o != nil && o.ArrayArrayOfInteger != nil { + return true + } + + return false +} + +// SetArrayArrayOfInteger gets a reference to the given [][]int64 and assigns it to the ArrayArrayOfInteger field. +func (o *ArrayTest) SetArrayArrayOfInteger(v [][]int64) { + o.ArrayArrayOfInteger = &v +} + +// GetArrayArrayOfModel returns the ArrayArrayOfModel field if non-nil, zero value otherwise. +func (o *ArrayTest) GetArrayArrayOfModel() [][]ReadOnlyFirst { + if o == nil || o.ArrayArrayOfModel == nil { + var ret [][]ReadOnlyFirst + return ret + } + return *o.ArrayArrayOfModel +} + +// GetArrayArrayOfModelOk returns a tuple with the ArrayArrayOfModel field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ArrayTest) GetArrayArrayOfModelOk() ([][]ReadOnlyFirst, bool) { + if o == nil || o.ArrayArrayOfModel == nil { + var ret [][]ReadOnlyFirst + return ret, false + } + return *o.ArrayArrayOfModel, true +} + +// HasArrayArrayOfModel returns a boolean if a field has been set. +func (o *ArrayTest) HasArrayArrayOfModel() bool { + if o != nil && o.ArrayArrayOfModel != nil { + return true + } + + return false +} + +// SetArrayArrayOfModel gets a reference to the given [][]ReadOnlyFirst and assigns it to the ArrayArrayOfModel field. +func (o *ArrayTest) SetArrayArrayOfModel(v [][]ReadOnlyFirst) { + o.ArrayArrayOfModel = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o ArrayTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ArrayOfString != nil { + toSerialize["array_of_string"] = o.ArrayOfString + } + if o.ArrayArrayOfInteger != nil { + toSerialize["array_array_of_integer"] = o.ArrayArrayOfInteger + } + if o.ArrayArrayOfModel != nil { + toSerialize["array_array_of_model"] = o.ArrayArrayOfModel + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go new file mode 100644 index 00000000000..152069cde94 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_capitalization.go @@ -0,0 +1,254 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// Capitalization struct for Capitalization +type Capitalization struct { + SmallCamel *string `json:"smallCamel,omitempty"` + + CapitalCamel *string `json:"CapitalCamel,omitempty"` + + SmallSnake *string `json:"small_Snake,omitempty"` + + CapitalSnake *string `json:"Capital_Snake,omitempty"` + + SCAETHFlowPoints *string `json:"SCA_ETH_Flow_Points,omitempty"` + + // Name of the pet + ATT_NAME *string `json:"ATT_NAME,omitempty"` + +} + +// GetSmallCamel returns the SmallCamel field if non-nil, zero value otherwise. +func (o *Capitalization) GetSmallCamel() string { + if o == nil || o.SmallCamel == nil { + var ret string + return ret + } + return *o.SmallCamel +} + +// GetSmallCamelOk returns a tuple with the SmallCamel field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallCamelOk() (string, bool) { + if o == nil || o.SmallCamel == nil { + var ret string + return ret, false + } + return *o.SmallCamel, true +} + +// HasSmallCamel returns a boolean if a field has been set. +func (o *Capitalization) HasSmallCamel() bool { + if o != nil && o.SmallCamel != nil { + return true + } + + return false +} + +// SetSmallCamel gets a reference to the given string and assigns it to the SmallCamel field. +func (o *Capitalization) SetSmallCamel(v string) { + o.SmallCamel = &v +} + +// GetCapitalCamel returns the CapitalCamel field if non-nil, zero value otherwise. +func (o *Capitalization) GetCapitalCamel() string { + if o == nil || o.CapitalCamel == nil { + var ret string + return ret + } + return *o.CapitalCamel +} + +// GetCapitalCamelOk returns a tuple with the CapitalCamel field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalCamelOk() (string, bool) { + if o == nil || o.CapitalCamel == nil { + var ret string + return ret, false + } + return *o.CapitalCamel, true +} + +// HasCapitalCamel returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalCamel() bool { + if o != nil && o.CapitalCamel != nil { + return true + } + + return false +} + +// SetCapitalCamel gets a reference to the given string and assigns it to the CapitalCamel field. +func (o *Capitalization) SetCapitalCamel(v string) { + o.CapitalCamel = &v +} + +// GetSmallSnake returns the SmallSnake field if non-nil, zero value otherwise. +func (o *Capitalization) GetSmallSnake() string { + if o == nil || o.SmallSnake == nil { + var ret string + return ret + } + return *o.SmallSnake +} + +// GetSmallSnakeOk returns a tuple with the SmallSnake field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSmallSnakeOk() (string, bool) { + if o == nil || o.SmallSnake == nil { + var ret string + return ret, false + } + return *o.SmallSnake, true +} + +// HasSmallSnake returns a boolean if a field has been set. +func (o *Capitalization) HasSmallSnake() bool { + if o != nil && o.SmallSnake != nil { + return true + } + + return false +} + +// SetSmallSnake gets a reference to the given string and assigns it to the SmallSnake field. +func (o *Capitalization) SetSmallSnake(v string) { + o.SmallSnake = &v +} + +// GetCapitalSnake returns the CapitalSnake field if non-nil, zero value otherwise. +func (o *Capitalization) GetCapitalSnake() string { + if o == nil || o.CapitalSnake == nil { + var ret string + return ret + } + return *o.CapitalSnake +} + +// GetCapitalSnakeOk returns a tuple with the CapitalSnake field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetCapitalSnakeOk() (string, bool) { + if o == nil || o.CapitalSnake == nil { + var ret string + return ret, false + } + return *o.CapitalSnake, true +} + +// HasCapitalSnake returns a boolean if a field has been set. +func (o *Capitalization) HasCapitalSnake() bool { + if o != nil && o.CapitalSnake != nil { + return true + } + + return false +} + +// SetCapitalSnake gets a reference to the given string and assigns it to the CapitalSnake field. +func (o *Capitalization) SetCapitalSnake(v string) { + o.CapitalSnake = &v +} + +// GetSCAETHFlowPoints returns the SCAETHFlowPoints field if non-nil, zero value otherwise. +func (o *Capitalization) GetSCAETHFlowPoints() string { + if o == nil || o.SCAETHFlowPoints == nil { + var ret string + return ret + } + return *o.SCAETHFlowPoints +} + +// GetSCAETHFlowPointsOk returns a tuple with the SCAETHFlowPoints field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetSCAETHFlowPointsOk() (string, bool) { + if o == nil || o.SCAETHFlowPoints == nil { + var ret string + return ret, false + } + return *o.SCAETHFlowPoints, true +} + +// HasSCAETHFlowPoints returns a boolean if a field has been set. +func (o *Capitalization) HasSCAETHFlowPoints() bool { + if o != nil && o.SCAETHFlowPoints != nil { + return true + } + + return false +} + +// SetSCAETHFlowPoints gets a reference to the given string and assigns it to the SCAETHFlowPoints field. +func (o *Capitalization) SetSCAETHFlowPoints(v string) { + o.SCAETHFlowPoints = &v +} + +// GetATT_NAME returns the ATT_NAME field if non-nil, zero value otherwise. +func (o *Capitalization) GetATT_NAME() string { + if o == nil || o.ATT_NAME == nil { + var ret string + return ret + } + return *o.ATT_NAME +} + +// GetATT_NAMEOk returns a tuple with the ATT_NAME field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Capitalization) GetATT_NAMEOk() (string, bool) { + if o == nil || o.ATT_NAME == nil { + var ret string + return ret, false + } + return *o.ATT_NAME, true +} + +// HasATT_NAME returns a boolean if a field has been set. +func (o *Capitalization) HasATT_NAME() bool { + if o != nil && o.ATT_NAME != nil { + return true + } + + return false +} + +// SetATT_NAME gets a reference to the given string and assigns it to the ATT_NAME field. +func (o *Capitalization) SetATT_NAME(v string) { + o.ATT_NAME = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Capitalization) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SmallCamel != nil { + toSerialize["smallCamel"] = o.SmallCamel + } + if o.CapitalCamel != nil { + toSerialize["CapitalCamel"] = o.CapitalCamel + } + if o.SmallSnake != nil { + toSerialize["small_Snake"] = o.SmallSnake + } + if o.CapitalSnake != nil { + toSerialize["Capital_Snake"] = o.CapitalSnake + } + if o.SCAETHFlowPoints != nil { + toSerialize["SCA_ETH_Flow_Points"] = o.SCAETHFlowPoints + } + if o.ATT_NAME != nil { + toSerialize["ATT_NAME"] = o.ATT_NAME + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go new file mode 100644 index 00000000000..68740a9cc9d --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat.go @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// Cat struct for Cat +type Cat struct { + ClassName *string `json:"className,omitempty"` + + Color *string `json:"color,omitempty"` + + Declawed *bool `json:"declawed,omitempty"` + +} + +// GetClassName returns the ClassName field if non-nil, zero value otherwise. +func (o *Cat) GetClassName() string { + if o == nil || o.ClassName == nil { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetClassNameOk() (string, bool) { + if o == nil || o.ClassName == nil { + var ret string + return ret, false + } + return *o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Cat) HasClassName() bool { + if o != nil && o.ClassName != nil { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Cat) SetClassName(v string) { + o.ClassName = &v +} + +// GetColor returns the Color field if non-nil, zero value otherwise. +func (o *Cat) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Cat) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Cat) SetColor(v string) { + o.Color = &v +} + +// GetDeclawed returns the Declawed field if non-nil, zero value otherwise. +func (o *Cat) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Cat) GetDeclawedOk() (bool, bool) { + if o == nil || o.Declawed == nil { + var ret bool + return ret, false + } + return *o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *Cat) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *Cat) SetDeclawed(v bool) { + o.Declawed = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Cat) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClassName == nil { + return nil, errors.New("ClassName is required and not nullable, but was not set on Cat") + } + if o.ClassName != nil { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go new file mode 100644 index 00000000000..0ae64baf61a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_cat_all_of.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// CatAllOf struct for CatAllOf +type CatAllOf struct { + Declawed *bool `json:"declawed,omitempty"` + +} + +// GetDeclawed returns the Declawed field if non-nil, zero value otherwise. +func (o *CatAllOf) GetDeclawed() bool { + if o == nil || o.Declawed == nil { + var ret bool + return ret + } + return *o.Declawed +} + +// GetDeclawedOk returns a tuple with the Declawed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *CatAllOf) GetDeclawedOk() (bool, bool) { + if o == nil || o.Declawed == nil { + var ret bool + return ret, false + } + return *o.Declawed, true +} + +// HasDeclawed returns a boolean if a field has been set. +func (o *CatAllOf) HasDeclawed() bool { + if o != nil && o.Declawed != nil { + return true + } + + return false +} + +// SetDeclawed gets a reference to the given bool and assigns it to the Declawed field. +func (o *CatAllOf) SetDeclawed(v bool) { + o.Declawed = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o CatAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Declawed != nil { + toSerialize["declawed"] = o.Declawed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go new file mode 100644 index 00000000000..40f16e0f205 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_category.go @@ -0,0 +1,105 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// Category struct for Category +type Category struct { + Id *int64 `json:"id,omitempty"` + + Name *string `json:"name,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Category) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Category) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Category) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Category) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Category) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Category) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Category) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Category) SetName(v string) { + o.Name = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Category) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name == nil { + return nil, errors.New("Name is required and not nullable, but was not set on Category") + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go new file mode 100644 index 00000000000..942013150ed --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_class_model.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// ClassModel Model for testing model with \"_class\" property +type ClassModel struct { + Class *string `json:"_class,omitempty"` + +} + +// GetClass returns the Class field if non-nil, zero value otherwise. +func (o *ClassModel) GetClass() string { + if o == nil || o.Class == nil { + var ret string + return ret + } + return *o.Class +} + +// GetClassOk returns a tuple with the Class field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ClassModel) GetClassOk() (string, bool) { + if o == nil || o.Class == nil { + var ret string + return ret, false + } + return *o.Class, true +} + +// HasClass returns a boolean if a field has been set. +func (o *ClassModel) HasClass() bool { + if o != nil && o.Class != nil { + return true + } + + return false +} + +// SetClass gets a reference to the given string and assigns it to the Class field. +func (o *ClassModel) SetClass(v string) { + o.Class = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o ClassModel) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Class != nil { + toSerialize["_class"] = o.Class + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go new file mode 100644 index 00000000000..926e0f9b155 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_client.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// Client struct for Client +type Client struct { + Client *string `json:"client,omitempty"` + +} + +// GetClient returns the Client field if non-nil, zero value otherwise. +func (o *Client) GetClient() string { + if o == nil || o.Client == nil { + var ret string + return ret + } + return *o.Client +} + +// GetClientOk returns a tuple with the Client field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Client) GetClientOk() (string, bool) { + if o == nil || o.Client == nil { + var ret string + return ret, false + } + return *o.Client, true +} + +// HasClient returns a boolean if a field has been set. +func (o *Client) HasClient() bool { + if o != nil && o.Client != nil { + return true + } + + return false +} + +// SetClient gets a reference to the given string and assigns it to the Client field. +func (o *Client) SetClient(v string) { + o.Client = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Client) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Client != nil { + toSerialize["client"] = o.Client + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go new file mode 100644 index 00000000000..d5e743b75af --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog.go @@ -0,0 +1,143 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// Dog struct for Dog +type Dog struct { + ClassName *string `json:"className,omitempty"` + + Color *string `json:"color,omitempty"` + + Breed *string `json:"breed,omitempty"` + +} + +// GetClassName returns the ClassName field if non-nil, zero value otherwise. +func (o *Dog) GetClassName() string { + if o == nil || o.ClassName == nil { + var ret string + return ret + } + return *o.ClassName +} + +// GetClassNameOk returns a tuple with the ClassName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetClassNameOk() (string, bool) { + if o == nil || o.ClassName == nil { + var ret string + return ret, false + } + return *o.ClassName, true +} + +// HasClassName returns a boolean if a field has been set. +func (o *Dog) HasClassName() bool { + if o != nil && o.ClassName != nil { + return true + } + + return false +} + +// SetClassName gets a reference to the given string and assigns it to the ClassName field. +func (o *Dog) SetClassName(v string) { + o.ClassName = &v +} + +// GetColor returns the Color field if non-nil, zero value otherwise. +func (o *Dog) GetColor() string { + if o == nil || o.Color == nil { + var ret string + return ret + } + return *o.Color +} + +// GetColorOk returns a tuple with the Color field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetColorOk() (string, bool) { + if o == nil || o.Color == nil { + var ret string + return ret, false + } + return *o.Color, true +} + +// HasColor returns a boolean if a field has been set. +func (o *Dog) HasColor() bool { + if o != nil && o.Color != nil { + return true + } + + return false +} + +// SetColor gets a reference to the given string and assigns it to the Color field. +func (o *Dog) SetColor(v string) { + o.Color = &v +} + +// GetBreed returns the Breed field if non-nil, zero value otherwise. +func (o *Dog) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Dog) GetBreedOk() (string, bool) { + if o == nil || o.Breed == nil { + var ret string + return ret, false + } + return *o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *Dog) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *Dog) SetBreed(v string) { + o.Breed = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Dog) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.ClassName == nil { + return nil, errors.New("ClassName is required and not nullable, but was not set on Dog") + } + if o.ClassName != nil { + toSerialize["className"] = o.ClassName + } + if o.Color != nil { + toSerialize["color"] = o.Color + } + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go new file mode 100644 index 00000000000..239229308c7 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_dog_all_of.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// DogAllOf struct for DogAllOf +type DogAllOf struct { + Breed *string `json:"breed,omitempty"` + +} + +// GetBreed returns the Breed field if non-nil, zero value otherwise. +func (o *DogAllOf) GetBreed() string { + if o == nil || o.Breed == nil { + var ret string + return ret + } + return *o.Breed +} + +// GetBreedOk returns a tuple with the Breed field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *DogAllOf) GetBreedOk() (string, bool) { + if o == nil || o.Breed == nil { + var ret string + return ret, false + } + return *o.Breed, true +} + +// HasBreed returns a boolean if a field has been set. +func (o *DogAllOf) HasBreed() bool { + if o != nil && o.Breed != nil { + return true + } + + return false +} + +// SetBreed gets a reference to the given string and assigns it to the Breed field. +func (o *DogAllOf) SetBreed(v string) { + o.Breed = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o DogAllOf) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Breed != nil { + toSerialize["breed"] = o.Breed + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go new file mode 100644 index 00000000000..4a06504b56e --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_arrays.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// EnumArrays struct for EnumArrays +type EnumArrays struct { + JustSymbol *string `json:"just_symbol,omitempty"` + + ArrayEnum *[]string `json:"array_enum,omitempty"` + +} + +// GetJustSymbol returns the JustSymbol field if non-nil, zero value otherwise. +func (o *EnumArrays) GetJustSymbol() string { + if o == nil || o.JustSymbol == nil { + var ret string + return ret + } + return *o.JustSymbol +} + +// GetJustSymbolOk returns a tuple with the JustSymbol field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetJustSymbolOk() (string, bool) { + if o == nil || o.JustSymbol == nil { + var ret string + return ret, false + } + return *o.JustSymbol, true +} + +// HasJustSymbol returns a boolean if a field has been set. +func (o *EnumArrays) HasJustSymbol() bool { + if o != nil && o.JustSymbol != nil { + return true + } + + return false +} + +// SetJustSymbol gets a reference to the given string and assigns it to the JustSymbol field. +func (o *EnumArrays) SetJustSymbol(v string) { + o.JustSymbol = &v +} + +// GetArrayEnum returns the ArrayEnum field if non-nil, zero value otherwise. +func (o *EnumArrays) GetArrayEnum() []string { + if o == nil || o.ArrayEnum == nil { + var ret []string + return ret + } + return *o.ArrayEnum +} + +// GetArrayEnumOk returns a tuple with the ArrayEnum field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumArrays) GetArrayEnumOk() ([]string, bool) { + if o == nil || o.ArrayEnum == nil { + var ret []string + return ret, false + } + return *o.ArrayEnum, true +} + +// HasArrayEnum returns a boolean if a field has been set. +func (o *EnumArrays) HasArrayEnum() bool { + if o != nil && o.ArrayEnum != nil { + return true + } + + return false +} + +// SetArrayEnum gets a reference to the given []string and assigns it to the ArrayEnum field. +func (o *EnumArrays) SetArrayEnum(v []string) { + o.ArrayEnum = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o EnumArrays) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustSymbol != nil { + toSerialize["just_symbol"] = o.JustSymbol + } + if o.ArrayEnum != nil { + toSerialize["array_enum"] = o.ArrayEnum + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go new file mode 100644 index 00000000000..6f7e93a9864 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_class.go @@ -0,0 +1,21 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +// EnumClass the model 'EnumClass' +type EnumClass string + +// List of EnumClass +const ( + ABC EnumClass = "_abc" + EFG EnumClass = "-efg" + XYZ EnumClass = "(xyz)" +) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go new file mode 100644 index 00000000000..5ed8bba1b74 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_enum_test_.go @@ -0,0 +1,344 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// EnumTest struct for EnumTest +type EnumTest struct { + EnumString *string `json:"enum_string,omitempty"` + + EnumStringRequired *string `json:"enum_string_required,omitempty"` + + EnumInteger *int32 `json:"enum_integer,omitempty"` + + EnumNumber *float64 `json:"enum_number,omitempty"` + + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` + isExplicitNullOuterEnum bool `json:"-"` + OuterEnumInteger *OuterEnumInteger `json:"outerEnumInteger,omitempty"` + + OuterEnumDefaultValue *OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` + + OuterEnumIntegerDefaultValue *OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` + +} + +// GetEnumString returns the EnumString field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumString() string { + if o == nil || o.EnumString == nil { + var ret string + return ret + } + return *o.EnumString +} + +// GetEnumStringOk returns a tuple with the EnumString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringOk() (string, bool) { + if o == nil || o.EnumString == nil { + var ret string + return ret, false + } + return *o.EnumString, true +} + +// HasEnumString returns a boolean if a field has been set. +func (o *EnumTest) HasEnumString() bool { + if o != nil && o.EnumString != nil { + return true + } + + return false +} + +// SetEnumString gets a reference to the given string and assigns it to the EnumString field. +func (o *EnumTest) SetEnumString(v string) { + o.EnumString = &v +} + +// GetEnumStringRequired returns the EnumStringRequired field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumStringRequired() string { + if o == nil || o.EnumStringRequired == nil { + var ret string + return ret + } + return *o.EnumStringRequired +} + +// GetEnumStringRequiredOk returns a tuple with the EnumStringRequired field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumStringRequiredOk() (string, bool) { + if o == nil || o.EnumStringRequired == nil { + var ret string + return ret, false + } + return *o.EnumStringRequired, true +} + +// HasEnumStringRequired returns a boolean if a field has been set. +func (o *EnumTest) HasEnumStringRequired() bool { + if o != nil && o.EnumStringRequired != nil { + return true + } + + return false +} + +// SetEnumStringRequired gets a reference to the given string and assigns it to the EnumStringRequired field. +func (o *EnumTest) SetEnumStringRequired(v string) { + o.EnumStringRequired = &v +} + +// GetEnumInteger returns the EnumInteger field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumInteger() int32 { + if o == nil || o.EnumInteger == nil { + var ret int32 + return ret + } + return *o.EnumInteger +} + +// GetEnumIntegerOk returns a tuple with the EnumInteger field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumIntegerOk() (int32, bool) { + if o == nil || o.EnumInteger == nil { + var ret int32 + return ret, false + } + return *o.EnumInteger, true +} + +// HasEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasEnumInteger() bool { + if o != nil && o.EnumInteger != nil { + return true + } + + return false +} + +// SetEnumInteger gets a reference to the given int32 and assigns it to the EnumInteger field. +func (o *EnumTest) SetEnumInteger(v int32) { + o.EnumInteger = &v +} + +// GetEnumNumber returns the EnumNumber field if non-nil, zero value otherwise. +func (o *EnumTest) GetEnumNumber() float64 { + if o == nil || o.EnumNumber == nil { + var ret float64 + return ret + } + return *o.EnumNumber +} + +// GetEnumNumberOk returns a tuple with the EnumNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetEnumNumberOk() (float64, bool) { + if o == nil || o.EnumNumber == nil { + var ret float64 + return ret, false + } + return *o.EnumNumber, true +} + +// HasEnumNumber returns a boolean if a field has been set. +func (o *EnumTest) HasEnumNumber() bool { + if o != nil && o.EnumNumber != nil { + return true + } + + return false +} + +// SetEnumNumber gets a reference to the given float64 and assigns it to the EnumNumber field. +func (o *EnumTest) SetEnumNumber(v float64) { + o.EnumNumber = &v +} + +// GetOuterEnum returns the OuterEnum field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnum() OuterEnum { + if o == nil || o.OuterEnum == nil { + var ret OuterEnum + return ret + } + return *o.OuterEnum +} + +// GetOuterEnumOk returns a tuple with the OuterEnum field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumOk() (OuterEnum, bool) { + if o == nil || o.OuterEnum == nil { + var ret OuterEnum + return ret, false + } + return *o.OuterEnum, true +} + +// HasOuterEnum returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnum() bool { + if o != nil && o.OuterEnum != nil { + return true + } + + return false +} + +// SetOuterEnum gets a reference to the given OuterEnum and assigns it to the OuterEnum field. +func (o *EnumTest) SetOuterEnum(v OuterEnum) { + o.OuterEnum = &v +} + +// SetOuterEnumExplicitNull (un)sets OuterEnum to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The OuterEnum value is set to nil even if false is passed +func (o *EnumTest) SetOuterEnumExplicitNull(b bool) { + o.OuterEnum = nil + o.isExplicitNullOuterEnum = b +} +// GetOuterEnumInteger returns the OuterEnumInteger field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnumInteger() OuterEnumInteger { + if o == nil || o.OuterEnumInteger == nil { + var ret OuterEnumInteger + return ret + } + return *o.OuterEnumInteger +} + +// GetOuterEnumIntegerOk returns a tuple with the OuterEnumInteger field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumIntegerOk() (OuterEnumInteger, bool) { + if o == nil || o.OuterEnumInteger == nil { + var ret OuterEnumInteger + return ret, false + } + return *o.OuterEnumInteger, true +} + +// HasOuterEnumInteger returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumInteger() bool { + if o != nil && o.OuterEnumInteger != nil { + return true + } + + return false +} + +// SetOuterEnumInteger gets a reference to the given OuterEnumInteger and assigns it to the OuterEnumInteger field. +func (o *EnumTest) SetOuterEnumInteger(v OuterEnumInteger) { + o.OuterEnumInteger = &v +} + +// GetOuterEnumDefaultValue returns the OuterEnumDefaultValue field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnumDefaultValue() OuterEnumDefaultValue { + if o == nil || o.OuterEnumDefaultValue == nil { + var ret OuterEnumDefaultValue + return ret + } + return *o.OuterEnumDefaultValue +} + +// GetOuterEnumDefaultValueOk returns a tuple with the OuterEnumDefaultValue field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumDefaultValueOk() (OuterEnumDefaultValue, bool) { + if o == nil || o.OuterEnumDefaultValue == nil { + var ret OuterEnumDefaultValue + return ret, false + } + return *o.OuterEnumDefaultValue, true +} + +// HasOuterEnumDefaultValue returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumDefaultValue() bool { + if o != nil && o.OuterEnumDefaultValue != nil { + return true + } + + return false +} + +// SetOuterEnumDefaultValue gets a reference to the given OuterEnumDefaultValue and assigns it to the OuterEnumDefaultValue field. +func (o *EnumTest) SetOuterEnumDefaultValue(v OuterEnumDefaultValue) { + o.OuterEnumDefaultValue = &v +} + +// GetOuterEnumIntegerDefaultValue returns the OuterEnumIntegerDefaultValue field if non-nil, zero value otherwise. +func (o *EnumTest) GetOuterEnumIntegerDefaultValue() OuterEnumIntegerDefaultValue { + if o == nil || o.OuterEnumIntegerDefaultValue == nil { + var ret OuterEnumIntegerDefaultValue + return ret + } + return *o.OuterEnumIntegerDefaultValue +} + +// GetOuterEnumIntegerDefaultValueOk returns a tuple with the OuterEnumIntegerDefaultValue field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *EnumTest) GetOuterEnumIntegerDefaultValueOk() (OuterEnumIntegerDefaultValue, bool) { + if o == nil || o.OuterEnumIntegerDefaultValue == nil { + var ret OuterEnumIntegerDefaultValue + return ret, false + } + return *o.OuterEnumIntegerDefaultValue, true +} + +// HasOuterEnumIntegerDefaultValue returns a boolean if a field has been set. +func (o *EnumTest) HasOuterEnumIntegerDefaultValue() bool { + if o != nil && o.OuterEnumIntegerDefaultValue != nil { + return true + } + + return false +} + +// SetOuterEnumIntegerDefaultValue gets a reference to the given OuterEnumIntegerDefaultValue and assigns it to the OuterEnumIntegerDefaultValue field. +func (o *EnumTest) SetOuterEnumIntegerDefaultValue(v OuterEnumIntegerDefaultValue) { + o.OuterEnumIntegerDefaultValue = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o EnumTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumString != nil { + toSerialize["enum_string"] = o.EnumString + } + if o.EnumStringRequired == nil { + return nil, errors.New("EnumStringRequired is required and not nullable, but was not set on EnumTest") + } + if o.EnumStringRequired != nil { + toSerialize["enum_string_required"] = o.EnumStringRequired + } + if o.EnumInteger != nil { + toSerialize["enum_integer"] = o.EnumInteger + } + if o.EnumNumber != nil { + toSerialize["enum_number"] = o.EnumNumber + } + if o.OuterEnum == nil { + if o.isExplicitNullOuterEnum { + toSerialize["outerEnum"] = o.OuterEnum + } + } else { + toSerialize["outerEnum"] = o.OuterEnum + } + if o.OuterEnumInteger != nil { + toSerialize["outerEnumInteger"] = o.OuterEnumInteger + } + if o.OuterEnumDefaultValue != nil { + toSerialize["outerEnumDefaultValue"] = o.OuterEnumDefaultValue + } + if o.OuterEnumIntegerDefaultValue != nil { + toSerialize["outerEnumIntegerDefaultValue"] = o.OuterEnumIntegerDefaultValue + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go new file mode 100644 index 00000000000..a39a447e2b6 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file.go @@ -0,0 +1,64 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// File Must be named `File` for test. +type File struct { + // Test capitalization + SourceURI *string `json:"sourceURI,omitempty"` + +} + +// GetSourceURI returns the SourceURI field if non-nil, zero value otherwise. +func (o *File) GetSourceURI() string { + if o == nil || o.SourceURI == nil { + var ret string + return ret + } + return *o.SourceURI +} + +// GetSourceURIOk returns a tuple with the SourceURI field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *File) GetSourceURIOk() (string, bool) { + if o == nil || o.SourceURI == nil { + var ret string + return ret, false + } + return *o.SourceURI, true +} + +// HasSourceURI returns a boolean if a field has been set. +func (o *File) HasSourceURI() bool { + if o != nil && o.SourceURI != nil { + return true + } + + return false +} + +// SetSourceURI gets a reference to the given string and assigns it to the SourceURI field. +func (o *File) SetSourceURI(v string) { + o.SourceURI = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o File) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.SourceURI != nil { + toSerialize["sourceURI"] = o.SourceURI + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go new file mode 100644 index 00000000000..ce392ac89d3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_file_schema_test_class.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// FileSchemaTestClass struct for FileSchemaTestClass +type FileSchemaTestClass struct { + File *File `json:"file,omitempty"` + + Files *[]File `json:"files,omitempty"` + +} + +// GetFile returns the File field if non-nil, zero value otherwise. +func (o *FileSchemaTestClass) GetFile() File { + if o == nil || o.File == nil { + var ret File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFileOk() (File, bool) { + if o == nil || o.File == nil { + var ret File + return ret, false + } + return *o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given File and assigns it to the File field. +func (o *FileSchemaTestClass) SetFile(v File) { + o.File = &v +} + +// GetFiles returns the Files field if non-nil, zero value otherwise. +func (o *FileSchemaTestClass) GetFiles() []File { + if o == nil || o.Files == nil { + var ret []File + return ret + } + return *o.Files +} + +// GetFilesOk returns a tuple with the Files field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FileSchemaTestClass) GetFilesOk() ([]File, bool) { + if o == nil || o.Files == nil { + var ret []File + return ret, false + } + return *o.Files, true +} + +// HasFiles returns a boolean if a field has been set. +func (o *FileSchemaTestClass) HasFiles() bool { + if o != nil && o.Files != nil { + return true + } + + return false +} + +// SetFiles gets a reference to the given []File and assigns it to the Files field. +func (o *FileSchemaTestClass) SetFiles(v []File) { + o.Files = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o FileSchemaTestClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.File != nil { + toSerialize["file"] = o.File + } + if o.Files != nil { + toSerialize["files"] = o.Files + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go new file mode 100644 index 00000000000..ae61f7394bf --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_foo.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// Foo struct for Foo +type Foo struct { + Bar *string `json:"bar,omitempty"` + +} + +// GetBar returns the Bar field if non-nil, zero value otherwise. +func (o *Foo) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Foo) GetBarOk() (string, bool) { + if o == nil || o.Bar == nil { + var ret string + return ret, false + } + return *o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *Foo) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *Foo) SetBar(v string) { + o.Bar = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Foo) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go new file mode 100644 index 00000000000..a544db31360 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_format_test_.go @@ -0,0 +1,612 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "os" + "time" + "encoding/json" + "errors" +) +// FormatTest struct for FormatTest +type FormatTest struct { + Integer *int32 `json:"integer,omitempty"` + + Int32 *int32 `json:"int32,omitempty"` + + Int64 *int64 `json:"int64,omitempty"` + + Number *float32 `json:"number,omitempty"` + + Float *float32 `json:"float,omitempty"` + + Double *float64 `json:"double,omitempty"` + + String *string `json:"string,omitempty"` + + Byte *string `json:"byte,omitempty"` + + Binary **os.File `json:"binary,omitempty"` + + Date *string `json:"date,omitempty"` + + DateTime *time.Time `json:"dateTime,omitempty"` + + Uuid *string `json:"uuid,omitempty"` + + Password *string `json:"password,omitempty"` + + // A string that is a 10 digit number. Can have leading zeros. + PatternWithDigits *string `json:"pattern_with_digits,omitempty"` + + // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + PatternWithDigitsAndDelimiter *string `json:"pattern_with_digits_and_delimiter,omitempty"` + +} + +// GetInteger returns the Integer field if non-nil, zero value otherwise. +func (o *FormatTest) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetIntegerOk() (int32, bool) { + if o == nil || o.Integer == nil { + var ret int32 + return ret, false + } + return *o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *FormatTest) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *FormatTest) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field if non-nil, zero value otherwise. +func (o *FormatTest) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt32Ok() (int32, bool) { + if o == nil || o.Int32 == nil { + var ret int32 + return ret, false + } + return *o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *FormatTest) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *FormatTest) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field if non-nil, zero value otherwise. +func (o *FormatTest) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetInt64Ok() (int64, bool) { + if o == nil || o.Int64 == nil { + var ret int64 + return ret, false + } + return *o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *FormatTest) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *FormatTest) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field if non-nil, zero value otherwise. +func (o *FormatTest) GetNumber() float32 { + if o == nil || o.Number == nil { + var ret float32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetNumberOk() (float32, bool) { + if o == nil || o.Number == nil { + var ret float32 + return ret, false + } + return *o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *FormatTest) HasNumber() bool { + if o != nil && o.Number != nil { + return true + } + + return false +} + +// SetNumber gets a reference to the given float32 and assigns it to the Number field. +func (o *FormatTest) SetNumber(v float32) { + o.Number = &v +} + +// GetFloat returns the Float field if non-nil, zero value otherwise. +func (o *FormatTest) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetFloatOk() (float32, bool) { + if o == nil || o.Float == nil { + var ret float32 + return ret, false + } + return *o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *FormatTest) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *FormatTest) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field if non-nil, zero value otherwise. +func (o *FormatTest) GetDouble() float64 { + if o == nil || o.Double == nil { + var ret float64 + return ret + } + return *o.Double +} + +// GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDoubleOk() (float64, bool) { + if o == nil || o.Double == nil { + var ret float64 + return ret, false + } + return *o.Double, true +} + +// HasDouble returns a boolean if a field has been set. +func (o *FormatTest) HasDouble() bool { + if o != nil && o.Double != nil { + return true + } + + return false +} + +// SetDouble gets a reference to the given float64 and assigns it to the Double field. +func (o *FormatTest) SetDouble(v float64) { + o.Double = &v +} + +// GetString returns the String field if non-nil, zero value otherwise. +func (o *FormatTest) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetStringOk() (string, bool) { + if o == nil || o.String == nil { + var ret string + return ret, false + } + return *o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *FormatTest) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *FormatTest) SetString(v string) { + o.String = &v +} + +// GetByte returns the Byte field if non-nil, zero value otherwise. +func (o *FormatTest) GetByte() string { + if o == nil || o.Byte == nil { + var ret string + return ret + } + return *o.Byte +} + +// GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetByteOk() (string, bool) { + if o == nil || o.Byte == nil { + var ret string + return ret, false + } + return *o.Byte, true +} + +// HasByte returns a boolean if a field has been set. +func (o *FormatTest) HasByte() bool { + if o != nil && o.Byte != nil { + return true + } + + return false +} + +// SetByte gets a reference to the given string and assigns it to the Byte field. +func (o *FormatTest) SetByte(v string) { + o.Byte = &v +} + +// GetBinary returns the Binary field if non-nil, zero value otherwise. +func (o *FormatTest) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetBinaryOk() (*os.File, bool) { + if o == nil || o.Binary == nil { + var ret *os.File + return ret, false + } + return *o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *FormatTest) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *FormatTest) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field if non-nil, zero value otherwise. +func (o *FormatTest) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateOk() (string, bool) { + if o == nil || o.Date == nil { + var ret string + return ret, false + } + return *o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *FormatTest) HasDate() bool { + if o != nil && o.Date != nil { + return true + } + + return false +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *FormatTest) SetDate(v string) { + o.Date = &v +} + +// GetDateTime returns the DateTime field if non-nil, zero value otherwise. +func (o *FormatTest) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetDateTimeOk() (time.Time, bool) { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret, false + } + return *o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *FormatTest) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *FormatTest) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetUuid returns the Uuid field if non-nil, zero value otherwise. +func (o *FormatTest) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetUuidOk() (string, bool) { + if o == nil || o.Uuid == nil { + var ret string + return ret, false + } + return *o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *FormatTest) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *FormatTest) SetUuid(v string) { + o.Uuid = &v +} + +// GetPassword returns the Password field if non-nil, zero value otherwise. +func (o *FormatTest) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPasswordOk() (string, bool) { + if o == nil || o.Password == nil { + var ret string + return ret, false + } + return *o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *FormatTest) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *FormatTest) SetPassword(v string) { + o.Password = &v +} + +// GetPatternWithDigits returns the PatternWithDigits field if non-nil, zero value otherwise. +func (o *FormatTest) GetPatternWithDigits() string { + if o == nil || o.PatternWithDigits == nil { + var ret string + return ret + } + return *o.PatternWithDigits +} + +// GetPatternWithDigitsOk returns a tuple with the PatternWithDigits field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPatternWithDigitsOk() (string, bool) { + if o == nil || o.PatternWithDigits == nil { + var ret string + return ret, false + } + return *o.PatternWithDigits, true +} + +// HasPatternWithDigits returns a boolean if a field has been set. +func (o *FormatTest) HasPatternWithDigits() bool { + if o != nil && o.PatternWithDigits != nil { + return true + } + + return false +} + +// SetPatternWithDigits gets a reference to the given string and assigns it to the PatternWithDigits field. +func (o *FormatTest) SetPatternWithDigits(v string) { + o.PatternWithDigits = &v +} + +// GetPatternWithDigitsAndDelimiter returns the PatternWithDigitsAndDelimiter field if non-nil, zero value otherwise. +func (o *FormatTest) GetPatternWithDigitsAndDelimiter() string { + if o == nil || o.PatternWithDigitsAndDelimiter == nil { + var ret string + return ret + } + return *o.PatternWithDigitsAndDelimiter +} + +// GetPatternWithDigitsAndDelimiterOk returns a tuple with the PatternWithDigitsAndDelimiter field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *FormatTest) GetPatternWithDigitsAndDelimiterOk() (string, bool) { + if o == nil || o.PatternWithDigitsAndDelimiter == nil { + var ret string + return ret, false + } + return *o.PatternWithDigitsAndDelimiter, true +} + +// HasPatternWithDigitsAndDelimiter returns a boolean if a field has been set. +func (o *FormatTest) HasPatternWithDigitsAndDelimiter() bool { + if o != nil && o.PatternWithDigitsAndDelimiter != nil { + return true + } + + return false +} + +// SetPatternWithDigitsAndDelimiter gets a reference to the given string and assigns it to the PatternWithDigitsAndDelimiter field. +func (o *FormatTest) SetPatternWithDigitsAndDelimiter(v string) { + o.PatternWithDigitsAndDelimiter = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o FormatTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if o.Number == nil { + return nil, errors.New("Number is required and not nullable, but was not set on FormatTest") + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if o.Double != nil { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if o.Byte == nil { + return nil, errors.New("Byte is required and not nullable, but was not set on FormatTest") + } + if o.Byte != nil { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if o.Date == nil { + return nil, errors.New("Date is required and not nullable, but was not set on FormatTest") + } + if o.Date != nil { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.Password == nil { + return nil, errors.New("Password is required and not nullable, but was not set on FormatTest") + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.PatternWithDigits != nil { + toSerialize["pattern_with_digits"] = o.PatternWithDigits + } + if o.PatternWithDigitsAndDelimiter != nil { + toSerialize["pattern_with_digits_and_delimiter"] = o.PatternWithDigitsAndDelimiter + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go new file mode 100644 index 00000000000..708df847837 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_has_only_read_only.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// HasOnlyReadOnly struct for HasOnlyReadOnly +type HasOnlyReadOnly struct { + Bar *string `json:"bar,omitempty"` + + Foo *string `json:"foo,omitempty"` + +} + +// GetBar returns the Bar field if non-nil, zero value otherwise. +func (o *HasOnlyReadOnly) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetBarOk() (string, bool) { + if o == nil || o.Bar == nil { + var ret string + return ret, false + } + return *o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *HasOnlyReadOnly) SetBar(v string) { + o.Bar = &v +} + +// GetFoo returns the Foo field if non-nil, zero value otherwise. +func (o *HasOnlyReadOnly) GetFoo() string { + if o == nil || o.Foo == nil { + var ret string + return ret + } + return *o.Foo +} + +// GetFooOk returns a tuple with the Foo field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *HasOnlyReadOnly) GetFooOk() (string, bool) { + if o == nil || o.Foo == nil { + var ret string + return ret, false + } + return *o.Foo, true +} + +// HasFoo returns a boolean if a field has been set. +func (o *HasOnlyReadOnly) HasFoo() bool { + if o != nil && o.Foo != nil { + return true + } + + return false +} + +// SetFoo gets a reference to the given string and assigns it to the Foo field. +func (o *HasOnlyReadOnly) SetFoo(v string) { + o.Foo = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o HasOnlyReadOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Foo != nil { + toSerialize["foo"] = o.Foo + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go new file mode 100644 index 00000000000..6a83bf79144 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_health_check_result.go @@ -0,0 +1,74 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// HealthCheckResult Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. +type HealthCheckResult struct { + NullableMessage *string `json:"NullableMessage,omitempty"` + isExplicitNullNullableMessage bool `json:"-"` +} + +// GetNullableMessage returns the NullableMessage field if non-nil, zero value otherwise. +func (o *HealthCheckResult) GetNullableMessage() string { + if o == nil || o.NullableMessage == nil { + var ret string + return ret + } + return *o.NullableMessage +} + +// GetNullableMessageOk returns a tuple with the NullableMessage field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *HealthCheckResult) GetNullableMessageOk() (string, bool) { + if o == nil || o.NullableMessage == nil { + var ret string + return ret, false + } + return *o.NullableMessage, true +} + +// HasNullableMessage returns a boolean if a field has been set. +func (o *HealthCheckResult) HasNullableMessage() bool { + if o != nil && o.NullableMessage != nil { + return true + } + + return false +} + +// SetNullableMessage gets a reference to the given string and assigns it to the NullableMessage field. +func (o *HealthCheckResult) SetNullableMessage(v string) { + o.NullableMessage = &v +} + +// SetNullableMessageExplicitNull (un)sets NullableMessage to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The NullableMessage value is set to nil even if false is passed +func (o *HealthCheckResult) SetNullableMessageExplicitNull(b bool) { + o.NullableMessage = nil + o.isExplicitNullNullableMessage = b +} + +// MarshalJSON returns the JSON representation of the model. +func (o HealthCheckResult) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.NullableMessage == nil { + if o.isExplicitNullNullableMessage { + toSerialize["NullableMessage"] = o.NullableMessage + } + } else { + toSerialize["NullableMessage"] = o.NullableMessage + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go new file mode 100644 index 00000000000..830295fd4b9 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object.go @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// InlineObject struct for InlineObject +type InlineObject struct { + // Updated name of the pet + Name *string `json:"name,omitempty"` + + // Updated status of the pet + Status *string `json:"status,omitempty"` + +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *InlineObject) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *InlineObject) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *InlineObject) SetName(v string) { + o.Name = &v +} + +// GetStatus returns the Status field if non-nil, zero value otherwise. +func (o *InlineObject) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject) GetStatusOk() (string, bool) { + if o == nil || o.Status == nil { + var ret string + return ret, false + } + return *o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *InlineObject) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *InlineObject) SetStatus(v string) { + o.Status = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineObject) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go new file mode 100644 index 00000000000..0dc45833a76 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_1.go @@ -0,0 +1,104 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "os" + "encoding/json" +) +// InlineObject1 struct for InlineObject1 +type InlineObject1 struct { + // Additional data to pass to server + AdditionalMetadata *string `json:"additionalMetadata,omitempty"` + + // file to upload + File **os.File `json:"file,omitempty"` + +} + +// GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. +func (o *InlineObject1) GetAdditionalMetadata() string { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret + } + return *o.AdditionalMetadata +} + +// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetAdditionalMetadataOk() (string, bool) { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret, false + } + return *o.AdditionalMetadata, true +} + +// HasAdditionalMetadata returns a boolean if a field has been set. +func (o *InlineObject1) HasAdditionalMetadata() bool { + if o != nil && o.AdditionalMetadata != nil { + return true + } + + return false +} + +// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. +func (o *InlineObject1) SetAdditionalMetadata(v string) { + o.AdditionalMetadata = &v +} + +// GetFile returns the File field if non-nil, zero value otherwise. +func (o *InlineObject1) GetFile() *os.File { + if o == nil || o.File == nil { + var ret *os.File + return ret + } + return *o.File +} + +// GetFileOk returns a tuple with the File field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject1) GetFileOk() (*os.File, bool) { + if o == nil || o.File == nil { + var ret *os.File + return ret, false + } + return *o.File, true +} + +// HasFile returns a boolean if a field has been set. +func (o *InlineObject1) HasFile() bool { + if o != nil && o.File != nil { + return true + } + + return false +} + +// SetFile gets a reference to the given *os.File and assigns it to the File field. +func (o *InlineObject1) SetFile(v *os.File) { + o.File = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineObject1) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AdditionalMetadata != nil { + toSerialize["additionalMetadata"] = o.AdditionalMetadata + } + if o.File != nil { + toSerialize["file"] = o.File + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go new file mode 100644 index 00000000000..4b1bf9ec3a2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_2.go @@ -0,0 +1,103 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// InlineObject2 struct for InlineObject2 +type InlineObject2 struct { + // Form parameter enum test (string array) + EnumFormStringArray *[]string `json:"enum_form_string_array,omitempty"` + + // Form parameter enum test (string) + EnumFormString *string `json:"enum_form_string,omitempty"` + +} + +// GetEnumFormStringArray returns the EnumFormStringArray field if non-nil, zero value otherwise. +func (o *InlineObject2) GetEnumFormStringArray() []string { + if o == nil || o.EnumFormStringArray == nil { + var ret []string + return ret + } + return *o.EnumFormStringArray +} + +// GetEnumFormStringArrayOk returns a tuple with the EnumFormStringArray field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetEnumFormStringArrayOk() ([]string, bool) { + if o == nil || o.EnumFormStringArray == nil { + var ret []string + return ret, false + } + return *o.EnumFormStringArray, true +} + +// HasEnumFormStringArray returns a boolean if a field has been set. +func (o *InlineObject2) HasEnumFormStringArray() bool { + if o != nil && o.EnumFormStringArray != nil { + return true + } + + return false +} + +// SetEnumFormStringArray gets a reference to the given []string and assigns it to the EnumFormStringArray field. +func (o *InlineObject2) SetEnumFormStringArray(v []string) { + o.EnumFormStringArray = &v +} + +// GetEnumFormString returns the EnumFormString field if non-nil, zero value otherwise. +func (o *InlineObject2) GetEnumFormString() string { + if o == nil || o.EnumFormString == nil { + var ret string + return ret + } + return *o.EnumFormString +} + +// GetEnumFormStringOk returns a tuple with the EnumFormString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject2) GetEnumFormStringOk() (string, bool) { + if o == nil || o.EnumFormString == nil { + var ret string + return ret, false + } + return *o.EnumFormString, true +} + +// HasEnumFormString returns a boolean if a field has been set. +func (o *InlineObject2) HasEnumFormString() bool { + if o != nil && o.EnumFormString != nil { + return true + } + + return false +} + +// SetEnumFormString gets a reference to the given string and assigns it to the EnumFormString field. +func (o *InlineObject2) SetEnumFormString(v string) { + o.EnumFormString = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineObject2) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.EnumFormStringArray != nil { + toSerialize["enum_form_string_array"] = o.EnumFormStringArray + } + if o.EnumFormString != nil { + toSerialize["enum_form_string"] = o.EnumFormString + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go new file mode 100644 index 00000000000..54dd573d90c --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_3.go @@ -0,0 +1,586 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "os" + "time" + "encoding/json" + "errors" +) +// InlineObject3 struct for InlineObject3 +type InlineObject3 struct { + // None + Integer *int32 `json:"integer,omitempty"` + + // None + Int32 *int32 `json:"int32,omitempty"` + + // None + Int64 *int64 `json:"int64,omitempty"` + + // None + Number *float32 `json:"number,omitempty"` + + // None + Float *float32 `json:"float,omitempty"` + + // None + Double *float64 `json:"double,omitempty"` + + // None + String *string `json:"string,omitempty"` + + // None + PatternWithoutDelimiter *string `json:"pattern_without_delimiter,omitempty"` + + // None + Byte *string `json:"byte,omitempty"` + + // None + Binary **os.File `json:"binary,omitempty"` + + // None + Date *string `json:"date,omitempty"` + + // None + DateTime *time.Time `json:"dateTime,omitempty"` + + // None + Password *string `json:"password,omitempty"` + + // None + Callback *string `json:"callback,omitempty"` + +} + +// GetInteger returns the Integer field if non-nil, zero value otherwise. +func (o *InlineObject3) GetInteger() int32 { + if o == nil || o.Integer == nil { + var ret int32 + return ret + } + return *o.Integer +} + +// GetIntegerOk returns a tuple with the Integer field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetIntegerOk() (int32, bool) { + if o == nil || o.Integer == nil { + var ret int32 + return ret, false + } + return *o.Integer, true +} + +// HasInteger returns a boolean if a field has been set. +func (o *InlineObject3) HasInteger() bool { + if o != nil && o.Integer != nil { + return true + } + + return false +} + +// SetInteger gets a reference to the given int32 and assigns it to the Integer field. +func (o *InlineObject3) SetInteger(v int32) { + o.Integer = &v +} + +// GetInt32 returns the Int32 field if non-nil, zero value otherwise. +func (o *InlineObject3) GetInt32() int32 { + if o == nil || o.Int32 == nil { + var ret int32 + return ret + } + return *o.Int32 +} + +// GetInt32Ok returns a tuple with the Int32 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetInt32Ok() (int32, bool) { + if o == nil || o.Int32 == nil { + var ret int32 + return ret, false + } + return *o.Int32, true +} + +// HasInt32 returns a boolean if a field has been set. +func (o *InlineObject3) HasInt32() bool { + if o != nil && o.Int32 != nil { + return true + } + + return false +} + +// SetInt32 gets a reference to the given int32 and assigns it to the Int32 field. +func (o *InlineObject3) SetInt32(v int32) { + o.Int32 = &v +} + +// GetInt64 returns the Int64 field if non-nil, zero value otherwise. +func (o *InlineObject3) GetInt64() int64 { + if o == nil || o.Int64 == nil { + var ret int64 + return ret + } + return *o.Int64 +} + +// GetInt64Ok returns a tuple with the Int64 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetInt64Ok() (int64, bool) { + if o == nil || o.Int64 == nil { + var ret int64 + return ret, false + } + return *o.Int64, true +} + +// HasInt64 returns a boolean if a field has been set. +func (o *InlineObject3) HasInt64() bool { + if o != nil && o.Int64 != nil { + return true + } + + return false +} + +// SetInt64 gets a reference to the given int64 and assigns it to the Int64 field. +func (o *InlineObject3) SetInt64(v int64) { + o.Int64 = &v +} + +// GetNumber returns the Number field if non-nil, zero value otherwise. +func (o *InlineObject3) GetNumber() float32 { + if o == nil || o.Number == nil { + var ret float32 + return ret + } + return *o.Number +} + +// GetNumberOk returns a tuple with the Number field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetNumberOk() (float32, bool) { + if o == nil || o.Number == nil { + var ret float32 + return ret, false + } + return *o.Number, true +} + +// HasNumber returns a boolean if a field has been set. +func (o *InlineObject3) HasNumber() bool { + if o != nil && o.Number != nil { + return true + } + + return false +} + +// SetNumber gets a reference to the given float32 and assigns it to the Number field. +func (o *InlineObject3) SetNumber(v float32) { + o.Number = &v +} + +// GetFloat returns the Float field if non-nil, zero value otherwise. +func (o *InlineObject3) GetFloat() float32 { + if o == nil || o.Float == nil { + var ret float32 + return ret + } + return *o.Float +} + +// GetFloatOk returns a tuple with the Float field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetFloatOk() (float32, bool) { + if o == nil || o.Float == nil { + var ret float32 + return ret, false + } + return *o.Float, true +} + +// HasFloat returns a boolean if a field has been set. +func (o *InlineObject3) HasFloat() bool { + if o != nil && o.Float != nil { + return true + } + + return false +} + +// SetFloat gets a reference to the given float32 and assigns it to the Float field. +func (o *InlineObject3) SetFloat(v float32) { + o.Float = &v +} + +// GetDouble returns the Double field if non-nil, zero value otherwise. +func (o *InlineObject3) GetDouble() float64 { + if o == nil || o.Double == nil { + var ret float64 + return ret + } + return *o.Double +} + +// GetDoubleOk returns a tuple with the Double field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDoubleOk() (float64, bool) { + if o == nil || o.Double == nil { + var ret float64 + return ret, false + } + return *o.Double, true +} + +// HasDouble returns a boolean if a field has been set. +func (o *InlineObject3) HasDouble() bool { + if o != nil && o.Double != nil { + return true + } + + return false +} + +// SetDouble gets a reference to the given float64 and assigns it to the Double field. +func (o *InlineObject3) SetDouble(v float64) { + o.Double = &v +} + +// GetString returns the String field if non-nil, zero value otherwise. +func (o *InlineObject3) GetString() string { + if o == nil || o.String == nil { + var ret string + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetStringOk() (string, bool) { + if o == nil || o.String == nil { + var ret string + return ret, false + } + return *o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *InlineObject3) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given string and assigns it to the String field. +func (o *InlineObject3) SetString(v string) { + o.String = &v +} + +// GetPatternWithoutDelimiter returns the PatternWithoutDelimiter field if non-nil, zero value otherwise. +func (o *InlineObject3) GetPatternWithoutDelimiter() string { + if o == nil || o.PatternWithoutDelimiter == nil { + var ret string + return ret + } + return *o.PatternWithoutDelimiter +} + +// GetPatternWithoutDelimiterOk returns a tuple with the PatternWithoutDelimiter field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetPatternWithoutDelimiterOk() (string, bool) { + if o == nil || o.PatternWithoutDelimiter == nil { + var ret string + return ret, false + } + return *o.PatternWithoutDelimiter, true +} + +// HasPatternWithoutDelimiter returns a boolean if a field has been set. +func (o *InlineObject3) HasPatternWithoutDelimiter() bool { + if o != nil && o.PatternWithoutDelimiter != nil { + return true + } + + return false +} + +// SetPatternWithoutDelimiter gets a reference to the given string and assigns it to the PatternWithoutDelimiter field. +func (o *InlineObject3) SetPatternWithoutDelimiter(v string) { + o.PatternWithoutDelimiter = &v +} + +// GetByte returns the Byte field if non-nil, zero value otherwise. +func (o *InlineObject3) GetByte() string { + if o == nil || o.Byte == nil { + var ret string + return ret + } + return *o.Byte +} + +// GetByteOk returns a tuple with the Byte field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetByteOk() (string, bool) { + if o == nil || o.Byte == nil { + var ret string + return ret, false + } + return *o.Byte, true +} + +// HasByte returns a boolean if a field has been set. +func (o *InlineObject3) HasByte() bool { + if o != nil && o.Byte != nil { + return true + } + + return false +} + +// SetByte gets a reference to the given string and assigns it to the Byte field. +func (o *InlineObject3) SetByte(v string) { + o.Byte = &v +} + +// GetBinary returns the Binary field if non-nil, zero value otherwise. +func (o *InlineObject3) GetBinary() *os.File { + if o == nil || o.Binary == nil { + var ret *os.File + return ret + } + return *o.Binary +} + +// GetBinaryOk returns a tuple with the Binary field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetBinaryOk() (*os.File, bool) { + if o == nil || o.Binary == nil { + var ret *os.File + return ret, false + } + return *o.Binary, true +} + +// HasBinary returns a boolean if a field has been set. +func (o *InlineObject3) HasBinary() bool { + if o != nil && o.Binary != nil { + return true + } + + return false +} + +// SetBinary gets a reference to the given *os.File and assigns it to the Binary field. +func (o *InlineObject3) SetBinary(v *os.File) { + o.Binary = &v +} + +// GetDate returns the Date field if non-nil, zero value otherwise. +func (o *InlineObject3) GetDate() string { + if o == nil || o.Date == nil { + var ret string + return ret + } + return *o.Date +} + +// GetDateOk returns a tuple with the Date field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDateOk() (string, bool) { + if o == nil || o.Date == nil { + var ret string + return ret, false + } + return *o.Date, true +} + +// HasDate returns a boolean if a field has been set. +func (o *InlineObject3) HasDate() bool { + if o != nil && o.Date != nil { + return true + } + + return false +} + +// SetDate gets a reference to the given string and assigns it to the Date field. +func (o *InlineObject3) SetDate(v string) { + o.Date = &v +} + +// GetDateTime returns the DateTime field if non-nil, zero value otherwise. +func (o *InlineObject3) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetDateTimeOk() (time.Time, bool) { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret, false + } + return *o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *InlineObject3) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *InlineObject3) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetPassword returns the Password field if non-nil, zero value otherwise. +func (o *InlineObject3) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetPasswordOk() (string, bool) { + if o == nil || o.Password == nil { + var ret string + return ret, false + } + return *o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *InlineObject3) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *InlineObject3) SetPassword(v string) { + o.Password = &v +} + +// GetCallback returns the Callback field if non-nil, zero value otherwise. +func (o *InlineObject3) GetCallback() string { + if o == nil || o.Callback == nil { + var ret string + return ret + } + return *o.Callback +} + +// GetCallbackOk returns a tuple with the Callback field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject3) GetCallbackOk() (string, bool) { + if o == nil || o.Callback == nil { + var ret string + return ret, false + } + return *o.Callback, true +} + +// HasCallback returns a boolean if a field has been set. +func (o *InlineObject3) HasCallback() bool { + if o != nil && o.Callback != nil { + return true + } + + return false +} + +// SetCallback gets a reference to the given string and assigns it to the Callback field. +func (o *InlineObject3) SetCallback(v string) { + o.Callback = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineObject3) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Integer != nil { + toSerialize["integer"] = o.Integer + } + if o.Int32 != nil { + toSerialize["int32"] = o.Int32 + } + if o.Int64 != nil { + toSerialize["int64"] = o.Int64 + } + if o.Number == nil { + return nil, errors.New("Number is required and not nullable, but was not set on InlineObject3") + } + if o.Number != nil { + toSerialize["number"] = o.Number + } + if o.Float != nil { + toSerialize["float"] = o.Float + } + if o.Double == nil { + return nil, errors.New("Double is required and not nullable, but was not set on InlineObject3") + } + if o.Double != nil { + toSerialize["double"] = o.Double + } + if o.String != nil { + toSerialize["string"] = o.String + } + if o.PatternWithoutDelimiter == nil { + return nil, errors.New("PatternWithoutDelimiter is required and not nullable, but was not set on InlineObject3") + } + if o.PatternWithoutDelimiter != nil { + toSerialize["pattern_without_delimiter"] = o.PatternWithoutDelimiter + } + if o.Byte == nil { + return nil, errors.New("Byte is required and not nullable, but was not set on InlineObject3") + } + if o.Byte != nil { + toSerialize["byte"] = o.Byte + } + if o.Binary != nil { + toSerialize["binary"] = o.Binary + } + if o.Date != nil { + toSerialize["date"] = o.Date + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Callback != nil { + toSerialize["callback"] = o.Callback + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go new file mode 100644 index 00000000000..761f535d074 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_4.go @@ -0,0 +1,110 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// InlineObject4 struct for InlineObject4 +type InlineObject4 struct { + // field1 + Param *string `json:"param,omitempty"` + + // field2 + Param2 *string `json:"param2,omitempty"` + +} + +// GetParam returns the Param field if non-nil, zero value otherwise. +func (o *InlineObject4) GetParam() string { + if o == nil || o.Param == nil { + var ret string + return ret + } + return *o.Param +} + +// GetParamOk returns a tuple with the Param field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetParamOk() (string, bool) { + if o == nil || o.Param == nil { + var ret string + return ret, false + } + return *o.Param, true +} + +// HasParam returns a boolean if a field has been set. +func (o *InlineObject4) HasParam() bool { + if o != nil && o.Param != nil { + return true + } + + return false +} + +// SetParam gets a reference to the given string and assigns it to the Param field. +func (o *InlineObject4) SetParam(v string) { + o.Param = &v +} + +// GetParam2 returns the Param2 field if non-nil, zero value otherwise. +func (o *InlineObject4) GetParam2() string { + if o == nil || o.Param2 == nil { + var ret string + return ret + } + return *o.Param2 +} + +// GetParam2Ok returns a tuple with the Param2 field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject4) GetParam2Ok() (string, bool) { + if o == nil || o.Param2 == nil { + var ret string + return ret, false + } + return *o.Param2, true +} + +// HasParam2 returns a boolean if a field has been set. +func (o *InlineObject4) HasParam2() bool { + if o != nil && o.Param2 != nil { + return true + } + + return false +} + +// SetParam2 gets a reference to the given string and assigns it to the Param2 field. +func (o *InlineObject4) SetParam2(v string) { + o.Param2 = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineObject4) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Param == nil { + return nil, errors.New("Param is required and not nullable, but was not set on InlineObject4") + } + if o.Param != nil { + toSerialize["param"] = o.Param + } + if o.Param2 == nil { + return nil, errors.New("Param2 is required and not nullable, but was not set on InlineObject4") + } + if o.Param2 != nil { + toSerialize["param2"] = o.Param2 + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go new file mode 100644 index 00000000000..3699a33df46 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_object_5.go @@ -0,0 +1,108 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "os" + "encoding/json" + "errors" +) +// InlineObject5 struct for InlineObject5 +type InlineObject5 struct { + // Additional data to pass to server + AdditionalMetadata *string `json:"additionalMetadata,omitempty"` + + // file to upload + RequiredFile **os.File `json:"requiredFile,omitempty"` + +} + +// GetAdditionalMetadata returns the AdditionalMetadata field if non-nil, zero value otherwise. +func (o *InlineObject5) GetAdditionalMetadata() string { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret + } + return *o.AdditionalMetadata +} + +// GetAdditionalMetadataOk returns a tuple with the AdditionalMetadata field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetAdditionalMetadataOk() (string, bool) { + if o == nil || o.AdditionalMetadata == nil { + var ret string + return ret, false + } + return *o.AdditionalMetadata, true +} + +// HasAdditionalMetadata returns a boolean if a field has been set. +func (o *InlineObject5) HasAdditionalMetadata() bool { + if o != nil && o.AdditionalMetadata != nil { + return true + } + + return false +} + +// SetAdditionalMetadata gets a reference to the given string and assigns it to the AdditionalMetadata field. +func (o *InlineObject5) SetAdditionalMetadata(v string) { + o.AdditionalMetadata = &v +} + +// GetRequiredFile returns the RequiredFile field if non-nil, zero value otherwise. +func (o *InlineObject5) GetRequiredFile() *os.File { + if o == nil || o.RequiredFile == nil { + var ret *os.File + return ret + } + return *o.RequiredFile +} + +// GetRequiredFileOk returns a tuple with the RequiredFile field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineObject5) GetRequiredFileOk() (*os.File, bool) { + if o == nil || o.RequiredFile == nil { + var ret *os.File + return ret, false + } + return *o.RequiredFile, true +} + +// HasRequiredFile returns a boolean if a field has been set. +func (o *InlineObject5) HasRequiredFile() bool { + if o != nil && o.RequiredFile != nil { + return true + } + + return false +} + +// SetRequiredFile gets a reference to the given *os.File and assigns it to the RequiredFile field. +func (o *InlineObject5) SetRequiredFile(v *os.File) { + o.RequiredFile = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineObject5) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.AdditionalMetadata != nil { + toSerialize["additionalMetadata"] = o.AdditionalMetadata + } + if o.RequiredFile == nil { + return nil, errors.New("RequiredFile is required and not nullable, but was not set on InlineObject5") + } + if o.RequiredFile != nil { + toSerialize["requiredFile"] = o.RequiredFile + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go new file mode 100644 index 00000000000..024ad4f84ea --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_inline_response_default.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// InlineResponseDefault struct for InlineResponseDefault +type InlineResponseDefault struct { + String *Foo `json:"string,omitempty"` + +} + +// GetString returns the String field if non-nil, zero value otherwise. +func (o *InlineResponseDefault) GetString() Foo { + if o == nil || o.String == nil { + var ret Foo + return ret + } + return *o.String +} + +// GetStringOk returns a tuple with the String field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *InlineResponseDefault) GetStringOk() (Foo, bool) { + if o == nil || o.String == nil { + var ret Foo + return ret, false + } + return *o.String, true +} + +// HasString returns a boolean if a field has been set. +func (o *InlineResponseDefault) HasString() bool { + if o != nil && o.String != nil { + return true + } + + return false +} + +// SetString gets a reference to the given Foo and assigns it to the String field. +func (o *InlineResponseDefault) SetString(v Foo) { + o.String = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o InlineResponseDefault) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.String != nil { + toSerialize["string"] = o.String + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go new file mode 100644 index 00000000000..efa6dfd86a1 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_list.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// List struct for List +type List struct { + Var123List *string `json:"123-list,omitempty"` + +} + +// GetVar123List returns the Var123List field if non-nil, zero value otherwise. +func (o *List) GetVar123List() string { + if o == nil || o.Var123List == nil { + var ret string + return ret + } + return *o.Var123List +} + +// GetVar123ListOk returns a tuple with the Var123List field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *List) GetVar123ListOk() (string, bool) { + if o == nil || o.Var123List == nil { + var ret string + return ret, false + } + return *o.Var123List, true +} + +// HasVar123List returns a boolean if a field has been set. +func (o *List) HasVar123List() bool { + if o != nil && o.Var123List != nil { + return true + } + + return false +} + +// SetVar123List gets a reference to the given string and assigns it to the Var123List field. +func (o *List) SetVar123List(v string) { + o.Var123List = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o List) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Var123List != nil { + toSerialize["123-list"] = o.Var123List + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go new file mode 100644 index 00000000000..d934df451ae --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_map_test_.go @@ -0,0 +1,177 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// MapTest struct for MapTest +type MapTest struct { + MapMapOfString *map[string]map[string]string `json:"map_map_of_string,omitempty"` + + MapOfEnumString *map[string]string `json:"map_of_enum_string,omitempty"` + + DirectMap *map[string]bool `json:"direct_map,omitempty"` + + IndirectMap *map[string]bool `json:"indirect_map,omitempty"` + +} + +// GetMapMapOfString returns the MapMapOfString field if non-nil, zero value otherwise. +func (o *MapTest) GetMapMapOfString() map[string]map[string]string { + if o == nil || o.MapMapOfString == nil { + var ret map[string]map[string]string + return ret + } + return *o.MapMapOfString +} + +// GetMapMapOfStringOk returns a tuple with the MapMapOfString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapMapOfStringOk() (map[string]map[string]string, bool) { + if o == nil || o.MapMapOfString == nil { + var ret map[string]map[string]string + return ret, false + } + return *o.MapMapOfString, true +} + +// HasMapMapOfString returns a boolean if a field has been set. +func (o *MapTest) HasMapMapOfString() bool { + if o != nil && o.MapMapOfString != nil { + return true + } + + return false +} + +// SetMapMapOfString gets a reference to the given map[string]map[string]string and assigns it to the MapMapOfString field. +func (o *MapTest) SetMapMapOfString(v map[string]map[string]string) { + o.MapMapOfString = &v +} + +// GetMapOfEnumString returns the MapOfEnumString field if non-nil, zero value otherwise. +func (o *MapTest) GetMapOfEnumString() map[string]string { + if o == nil || o.MapOfEnumString == nil { + var ret map[string]string + return ret + } + return *o.MapOfEnumString +} + +// GetMapOfEnumStringOk returns a tuple with the MapOfEnumString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetMapOfEnumStringOk() (map[string]string, bool) { + if o == nil || o.MapOfEnumString == nil { + var ret map[string]string + return ret, false + } + return *o.MapOfEnumString, true +} + +// HasMapOfEnumString returns a boolean if a field has been set. +func (o *MapTest) HasMapOfEnumString() bool { + if o != nil && o.MapOfEnumString != nil { + return true + } + + return false +} + +// SetMapOfEnumString gets a reference to the given map[string]string and assigns it to the MapOfEnumString field. +func (o *MapTest) SetMapOfEnumString(v map[string]string) { + o.MapOfEnumString = &v +} + +// GetDirectMap returns the DirectMap field if non-nil, zero value otherwise. +func (o *MapTest) GetDirectMap() map[string]bool { + if o == nil || o.DirectMap == nil { + var ret map[string]bool + return ret + } + return *o.DirectMap +} + +// GetDirectMapOk returns a tuple with the DirectMap field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetDirectMapOk() (map[string]bool, bool) { + if o == nil || o.DirectMap == nil { + var ret map[string]bool + return ret, false + } + return *o.DirectMap, true +} + +// HasDirectMap returns a boolean if a field has been set. +func (o *MapTest) HasDirectMap() bool { + if o != nil && o.DirectMap != nil { + return true + } + + return false +} + +// SetDirectMap gets a reference to the given map[string]bool and assigns it to the DirectMap field. +func (o *MapTest) SetDirectMap(v map[string]bool) { + o.DirectMap = &v +} + +// GetIndirectMap returns the IndirectMap field if non-nil, zero value otherwise. +func (o *MapTest) GetIndirectMap() map[string]bool { + if o == nil || o.IndirectMap == nil { + var ret map[string]bool + return ret + } + return *o.IndirectMap +} + +// GetIndirectMapOk returns a tuple with the IndirectMap field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MapTest) GetIndirectMapOk() (map[string]bool, bool) { + if o == nil || o.IndirectMap == nil { + var ret map[string]bool + return ret, false + } + return *o.IndirectMap, true +} + +// HasIndirectMap returns a boolean if a field has been set. +func (o *MapTest) HasIndirectMap() bool { + if o != nil && o.IndirectMap != nil { + return true + } + + return false +} + +// SetIndirectMap gets a reference to the given map[string]bool and assigns it to the IndirectMap field. +func (o *MapTest) SetIndirectMap(v map[string]bool) { + o.IndirectMap = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o MapTest) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MapMapOfString != nil { + toSerialize["map_map_of_string"] = o.MapMapOfString + } + if o.MapOfEnumString != nil { + toSerialize["map_of_enum_string"] = o.MapOfEnumString + } + if o.DirectMap != nil { + toSerialize["direct_map"] = o.DirectMap + } + if o.IndirectMap != nil { + toSerialize["indirect_map"] = o.IndirectMap + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go new file mode 100644 index 00000000000..d4756b2da4f --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_mixed_properties_and_additional_properties_class.go @@ -0,0 +1,140 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "time" + "encoding/json" +) +// MixedPropertiesAndAdditionalPropertiesClass struct for MixedPropertiesAndAdditionalPropertiesClass +type MixedPropertiesAndAdditionalPropertiesClass struct { + Uuid *string `json:"uuid,omitempty"` + + DateTime *time.Time `json:"dateTime,omitempty"` + + Map *map[string]Animal `json:"map,omitempty"` + +} + +// GetUuid returns the Uuid field if non-nil, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuid() string { + if o == nil || o.Uuid == nil { + var ret string + return ret + } + return *o.Uuid +} + +// GetUuidOk returns a tuple with the Uuid field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetUuidOk() (string, bool) { + if o == nil || o.Uuid == nil { + var ret string + return ret, false + } + return *o.Uuid, true +} + +// HasUuid returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasUuid() bool { + if o != nil && o.Uuid != nil { + return true + } + + return false +} + +// SetUuid gets a reference to the given string and assigns it to the Uuid field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetUuid(v string) { + o.Uuid = &v +} + +// GetDateTime returns the DateTime field if non-nil, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTime() time.Time { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret + } + return *o.DateTime +} + +// GetDateTimeOk returns a tuple with the DateTime field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetDateTimeOk() (time.Time, bool) { + if o == nil || o.DateTime == nil { + var ret time.Time + return ret, false + } + return *o.DateTime, true +} + +// HasDateTime returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasDateTime() bool { + if o != nil && o.DateTime != nil { + return true + } + + return false +} + +// SetDateTime gets a reference to the given time.Time and assigns it to the DateTime field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetDateTime(v time.Time) { + o.DateTime = &v +} + +// GetMap returns the Map field if non-nil, zero value otherwise. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMap() map[string]Animal { + if o == nil || o.Map == nil { + var ret map[string]Animal + return ret + } + return *o.Map +} + +// GetMapOk returns a tuple with the Map field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) GetMapOk() (map[string]Animal, bool) { + if o == nil || o.Map == nil { + var ret map[string]Animal + return ret, false + } + return *o.Map, true +} + +// HasMap returns a boolean if a field has been set. +func (o *MixedPropertiesAndAdditionalPropertiesClass) HasMap() bool { + if o != nil && o.Map != nil { + return true + } + + return false +} + +// SetMap gets a reference to the given map[string]Animal and assigns it to the Map field. +func (o *MixedPropertiesAndAdditionalPropertiesClass) SetMap(v map[string]Animal) { + o.Map = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o MixedPropertiesAndAdditionalPropertiesClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Uuid != nil { + toSerialize["uuid"] = o.Uuid + } + if o.DateTime != nil { + toSerialize["dateTime"] = o.DateTime + } + if o.Map != nil { + toSerialize["map"] = o.Map + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go new file mode 100644 index 00000000000..78990e5e97a --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_name.go @@ -0,0 +1,181 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// Name Model for testing model name same as property name +type Name struct { + Name *int32 `json:"name,omitempty"` + + SnakeCase *int32 `json:"snake_case,omitempty"` + + Property *string `json:"property,omitempty"` + + Var123Number *int32 `json:"123Number,omitempty"` + +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Name) GetName() int32 { + if o == nil || o.Name == nil { + var ret int32 + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetNameOk() (int32, bool) { + if o == nil || o.Name == nil { + var ret int32 + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Name) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given int32 and assigns it to the Name field. +func (o *Name) SetName(v int32) { + o.Name = &v +} + +// GetSnakeCase returns the SnakeCase field if non-nil, zero value otherwise. +func (o *Name) GetSnakeCase() int32 { + if o == nil || o.SnakeCase == nil { + var ret int32 + return ret + } + return *o.SnakeCase +} + +// GetSnakeCaseOk returns a tuple with the SnakeCase field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetSnakeCaseOk() (int32, bool) { + if o == nil || o.SnakeCase == nil { + var ret int32 + return ret, false + } + return *o.SnakeCase, true +} + +// HasSnakeCase returns a boolean if a field has been set. +func (o *Name) HasSnakeCase() bool { + if o != nil && o.SnakeCase != nil { + return true + } + + return false +} + +// SetSnakeCase gets a reference to the given int32 and assigns it to the SnakeCase field. +func (o *Name) SetSnakeCase(v int32) { + o.SnakeCase = &v +} + +// GetProperty returns the Property field if non-nil, zero value otherwise. +func (o *Name) GetProperty() string { + if o == nil || o.Property == nil { + var ret string + return ret + } + return *o.Property +} + +// GetPropertyOk returns a tuple with the Property field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetPropertyOk() (string, bool) { + if o == nil || o.Property == nil { + var ret string + return ret, false + } + return *o.Property, true +} + +// HasProperty returns a boolean if a field has been set. +func (o *Name) HasProperty() bool { + if o != nil && o.Property != nil { + return true + } + + return false +} + +// SetProperty gets a reference to the given string and assigns it to the Property field. +func (o *Name) SetProperty(v string) { + o.Property = &v +} + +// GetVar123Number returns the Var123Number field if non-nil, zero value otherwise. +func (o *Name) GetVar123Number() int32 { + if o == nil || o.Var123Number == nil { + var ret int32 + return ret + } + return *o.Var123Number +} + +// GetVar123NumberOk returns a tuple with the Var123Number field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Name) GetVar123NumberOk() (int32, bool) { + if o == nil || o.Var123Number == nil { + var ret int32 + return ret, false + } + return *o.Var123Number, true +} + +// HasVar123Number returns a boolean if a field has been set. +func (o *Name) HasVar123Number() bool { + if o != nil && o.Var123Number != nil { + return true + } + + return false +} + +// SetVar123Number gets a reference to the given int32 and assigns it to the Var123Number field. +func (o *Name) SetVar123Number(v int32) { + o.Var123Number = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Name) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Name == nil { + return nil, errors.New("Name is required and not nullable, but was not set on Name") + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.SnakeCase != nil { + toSerialize["snake_case"] = o.SnakeCase + } + if o.Property != nil { + toSerialize["property"] = o.Property + } + if o.Var123Number != nil { + toSerialize["123Number"] = o.Var123Number + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go new file mode 100644 index 00000000000..88b3d27a7db --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_nullable_class.go @@ -0,0 +1,592 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "time" + "encoding/json" +) +// NullableClass struct for NullableClass +type NullableClass struct { + IntegerProp *int32 `json:"integer_prop,omitempty"` + isExplicitNullIntegerProp bool `json:"-"` + NumberProp *float32 `json:"number_prop,omitempty"` + isExplicitNullNumberProp bool `json:"-"` + BooleanProp *bool `json:"boolean_prop,omitempty"` + isExplicitNullBooleanProp bool `json:"-"` + StringProp *string `json:"string_prop,omitempty"` + isExplicitNullStringProp bool `json:"-"` + DateProp *string `json:"date_prop,omitempty"` + isExplicitNullDateProp bool `json:"-"` + DatetimeProp *time.Time `json:"datetime_prop,omitempty"` + isExplicitNullDatetimeProp bool `json:"-"` + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + isExplicitNullArrayNullableProp bool `json:"-"` + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + isExplicitNullArrayAndItemsNullableProp bool `json:"-"` + ArrayItemsNullable *[]map[string]interface{} `json:"array_items_nullable,omitempty"` + + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + isExplicitNullObjectNullableProp bool `json:"-"` + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + isExplicitNullObjectAndItemsNullableProp bool `json:"-"` + ObjectItemsNullable *map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` + +} + +// GetIntegerProp returns the IntegerProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetIntegerProp() int32 { + if o == nil || o.IntegerProp == nil { + var ret int32 + return ret + } + return *o.IntegerProp +} + +// GetIntegerPropOk returns a tuple with the IntegerProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetIntegerPropOk() (int32, bool) { + if o == nil || o.IntegerProp == nil { + var ret int32 + return ret, false + } + return *o.IntegerProp, true +} + +// HasIntegerProp returns a boolean if a field has been set. +func (o *NullableClass) HasIntegerProp() bool { + if o != nil && o.IntegerProp != nil { + return true + } + + return false +} + +// SetIntegerProp gets a reference to the given int32 and assigns it to the IntegerProp field. +func (o *NullableClass) SetIntegerProp(v int32) { + o.IntegerProp = &v +} + +// SetIntegerPropExplicitNull (un)sets IntegerProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The IntegerProp value is set to nil even if false is passed +func (o *NullableClass) SetIntegerPropExplicitNull(b bool) { + o.IntegerProp = nil + o.isExplicitNullIntegerProp = b +} +// GetNumberProp returns the NumberProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetNumberProp() float32 { + if o == nil || o.NumberProp == nil { + var ret float32 + return ret + } + return *o.NumberProp +} + +// GetNumberPropOk returns a tuple with the NumberProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetNumberPropOk() (float32, bool) { + if o == nil || o.NumberProp == nil { + var ret float32 + return ret, false + } + return *o.NumberProp, true +} + +// HasNumberProp returns a boolean if a field has been set. +func (o *NullableClass) HasNumberProp() bool { + if o != nil && o.NumberProp != nil { + return true + } + + return false +} + +// SetNumberProp gets a reference to the given float32 and assigns it to the NumberProp field. +func (o *NullableClass) SetNumberProp(v float32) { + o.NumberProp = &v +} + +// SetNumberPropExplicitNull (un)sets NumberProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The NumberProp value is set to nil even if false is passed +func (o *NullableClass) SetNumberPropExplicitNull(b bool) { + o.NumberProp = nil + o.isExplicitNullNumberProp = b +} +// GetBooleanProp returns the BooleanProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetBooleanProp() bool { + if o == nil || o.BooleanProp == nil { + var ret bool + return ret + } + return *o.BooleanProp +} + +// GetBooleanPropOk returns a tuple with the BooleanProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetBooleanPropOk() (bool, bool) { + if o == nil || o.BooleanProp == nil { + var ret bool + return ret, false + } + return *o.BooleanProp, true +} + +// HasBooleanProp returns a boolean if a field has been set. +func (o *NullableClass) HasBooleanProp() bool { + if o != nil && o.BooleanProp != nil { + return true + } + + return false +} + +// SetBooleanProp gets a reference to the given bool and assigns it to the BooleanProp field. +func (o *NullableClass) SetBooleanProp(v bool) { + o.BooleanProp = &v +} + +// SetBooleanPropExplicitNull (un)sets BooleanProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The BooleanProp value is set to nil even if false is passed +func (o *NullableClass) SetBooleanPropExplicitNull(b bool) { + o.BooleanProp = nil + o.isExplicitNullBooleanProp = b +} +// GetStringProp returns the StringProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetStringProp() string { + if o == nil || o.StringProp == nil { + var ret string + return ret + } + return *o.StringProp +} + +// GetStringPropOk returns a tuple with the StringProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetStringPropOk() (string, bool) { + if o == nil || o.StringProp == nil { + var ret string + return ret, false + } + return *o.StringProp, true +} + +// HasStringProp returns a boolean if a field has been set. +func (o *NullableClass) HasStringProp() bool { + if o != nil && o.StringProp != nil { + return true + } + + return false +} + +// SetStringProp gets a reference to the given string and assigns it to the StringProp field. +func (o *NullableClass) SetStringProp(v string) { + o.StringProp = &v +} + +// SetStringPropExplicitNull (un)sets StringProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The StringProp value is set to nil even if false is passed +func (o *NullableClass) SetStringPropExplicitNull(b bool) { + o.StringProp = nil + o.isExplicitNullStringProp = b +} +// GetDateProp returns the DateProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetDateProp() string { + if o == nil || o.DateProp == nil { + var ret string + return ret + } + return *o.DateProp +} + +// GetDatePropOk returns a tuple with the DateProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetDatePropOk() (string, bool) { + if o == nil || o.DateProp == nil { + var ret string + return ret, false + } + return *o.DateProp, true +} + +// HasDateProp returns a boolean if a field has been set. +func (o *NullableClass) HasDateProp() bool { + if o != nil && o.DateProp != nil { + return true + } + + return false +} + +// SetDateProp gets a reference to the given string and assigns it to the DateProp field. +func (o *NullableClass) SetDateProp(v string) { + o.DateProp = &v +} + +// SetDatePropExplicitNull (un)sets DateProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The DateProp value is set to nil even if false is passed +func (o *NullableClass) SetDatePropExplicitNull(b bool) { + o.DateProp = nil + o.isExplicitNullDateProp = b +} +// GetDatetimeProp returns the DatetimeProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetDatetimeProp() time.Time { + if o == nil || o.DatetimeProp == nil { + var ret time.Time + return ret + } + return *o.DatetimeProp +} + +// GetDatetimePropOk returns a tuple with the DatetimeProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetDatetimePropOk() (time.Time, bool) { + if o == nil || o.DatetimeProp == nil { + var ret time.Time + return ret, false + } + return *o.DatetimeProp, true +} + +// HasDatetimeProp returns a boolean if a field has been set. +func (o *NullableClass) HasDatetimeProp() bool { + if o != nil && o.DatetimeProp != nil { + return true + } + + return false +} + +// SetDatetimeProp gets a reference to the given time.Time and assigns it to the DatetimeProp field. +func (o *NullableClass) SetDatetimeProp(v time.Time) { + o.DatetimeProp = &v +} + +// SetDatetimePropExplicitNull (un)sets DatetimeProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The DatetimeProp value is set to nil even if false is passed +func (o *NullableClass) SetDatetimePropExplicitNull(b bool) { + o.DatetimeProp = nil + o.isExplicitNullDatetimeProp = b +} +// GetArrayNullableProp returns the ArrayNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetArrayNullableProp() []map[string]interface{} { + if o == nil || o.ArrayNullableProp == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayNullableProp +} + +// GetArrayNullablePropOk returns a tuple with the ArrayNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayNullablePropOk() ([]map[string]interface{}, bool) { + if o == nil || o.ArrayNullableProp == nil { + var ret []map[string]interface{} + return ret, false + } + return *o.ArrayNullableProp, true +} + +// HasArrayNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasArrayNullableProp() bool { + if o != nil && o.ArrayNullableProp != nil { + return true + } + + return false +} + +// SetArrayNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayNullableProp field. +func (o *NullableClass) SetArrayNullableProp(v []map[string]interface{}) { + o.ArrayNullableProp = &v +} + +// SetArrayNullablePropExplicitNull (un)sets ArrayNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ArrayNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetArrayNullablePropExplicitNull(b bool) { + o.ArrayNullableProp = nil + o.isExplicitNullArrayNullableProp = b +} +// GetArrayAndItemsNullableProp returns the ArrayAndItemsNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetArrayAndItemsNullableProp() []map[string]interface{} { + if o == nil || o.ArrayAndItemsNullableProp == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayAndItemsNullableProp +} + +// GetArrayAndItemsNullablePropOk returns a tuple with the ArrayAndItemsNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayAndItemsNullablePropOk() ([]map[string]interface{}, bool) { + if o == nil || o.ArrayAndItemsNullableProp == nil { + var ret []map[string]interface{} + return ret, false + } + return *o.ArrayAndItemsNullableProp, true +} + +// HasArrayAndItemsNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasArrayAndItemsNullableProp() bool { + if o != nil && o.ArrayAndItemsNullableProp != nil { + return true + } + + return false +} + +// SetArrayAndItemsNullableProp gets a reference to the given []map[string]interface{} and assigns it to the ArrayAndItemsNullableProp field. +func (o *NullableClass) SetArrayAndItemsNullableProp(v []map[string]interface{}) { + o.ArrayAndItemsNullableProp = &v +} + +// SetArrayAndItemsNullablePropExplicitNull (un)sets ArrayAndItemsNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ArrayAndItemsNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetArrayAndItemsNullablePropExplicitNull(b bool) { + o.ArrayAndItemsNullableProp = nil + o.isExplicitNullArrayAndItemsNullableProp = b +} +// GetArrayItemsNullable returns the ArrayItemsNullable field if non-nil, zero value otherwise. +func (o *NullableClass) GetArrayItemsNullable() []map[string]interface{} { + if o == nil || o.ArrayItemsNullable == nil { + var ret []map[string]interface{} + return ret + } + return *o.ArrayItemsNullable +} + +// GetArrayItemsNullableOk returns a tuple with the ArrayItemsNullable field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetArrayItemsNullableOk() ([]map[string]interface{}, bool) { + if o == nil || o.ArrayItemsNullable == nil { + var ret []map[string]interface{} + return ret, false + } + return *o.ArrayItemsNullable, true +} + +// HasArrayItemsNullable returns a boolean if a field has been set. +func (o *NullableClass) HasArrayItemsNullable() bool { + if o != nil && o.ArrayItemsNullable != nil { + return true + } + + return false +} + +// SetArrayItemsNullable gets a reference to the given []map[string]interface{} and assigns it to the ArrayItemsNullable field. +func (o *NullableClass) SetArrayItemsNullable(v []map[string]interface{}) { + o.ArrayItemsNullable = &v +} + +// GetObjectNullableProp returns the ObjectNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetObjectNullableProp() map[string]map[string]interface{} { + if o == nil || o.ObjectNullableProp == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectNullableProp +} + +// GetObjectNullablePropOk returns a tuple with the ObjectNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectNullablePropOk() (map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectNullableProp == nil { + var ret map[string]map[string]interface{} + return ret, false + } + return *o.ObjectNullableProp, true +} + +// HasObjectNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasObjectNullableProp() bool { + if o != nil && o.ObjectNullableProp != nil { + return true + } + + return false +} + +// SetObjectNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectNullableProp field. +func (o *NullableClass) SetObjectNullableProp(v map[string]map[string]interface{}) { + o.ObjectNullableProp = &v +} + +// SetObjectNullablePropExplicitNull (un)sets ObjectNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ObjectNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetObjectNullablePropExplicitNull(b bool) { + o.ObjectNullableProp = nil + o.isExplicitNullObjectNullableProp = b +} +// GetObjectAndItemsNullableProp returns the ObjectAndItemsNullableProp field if non-nil, zero value otherwise. +func (o *NullableClass) GetObjectAndItemsNullableProp() map[string]map[string]interface{} { + if o == nil || o.ObjectAndItemsNullableProp == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectAndItemsNullableProp +} + +// GetObjectAndItemsNullablePropOk returns a tuple with the ObjectAndItemsNullableProp field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectAndItemsNullablePropOk() (map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectAndItemsNullableProp == nil { + var ret map[string]map[string]interface{} + return ret, false + } + return *o.ObjectAndItemsNullableProp, true +} + +// HasObjectAndItemsNullableProp returns a boolean if a field has been set. +func (o *NullableClass) HasObjectAndItemsNullableProp() bool { + if o != nil && o.ObjectAndItemsNullableProp != nil { + return true + } + + return false +} + +// SetObjectAndItemsNullableProp gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectAndItemsNullableProp field. +func (o *NullableClass) SetObjectAndItemsNullableProp(v map[string]map[string]interface{}) { + o.ObjectAndItemsNullableProp = &v +} + +// SetObjectAndItemsNullablePropExplicitNull (un)sets ObjectAndItemsNullableProp to be considered as explicit "null" value +// when serializing to JSON (pass true as argument to set this, false to unset) +// The ObjectAndItemsNullableProp value is set to nil even if false is passed +func (o *NullableClass) SetObjectAndItemsNullablePropExplicitNull(b bool) { + o.ObjectAndItemsNullableProp = nil + o.isExplicitNullObjectAndItemsNullableProp = b +} +// GetObjectItemsNullable returns the ObjectItemsNullable field if non-nil, zero value otherwise. +func (o *NullableClass) GetObjectItemsNullable() map[string]map[string]interface{} { + if o == nil || o.ObjectItemsNullable == nil { + var ret map[string]map[string]interface{} + return ret + } + return *o.ObjectItemsNullable +} + +// GetObjectItemsNullableOk returns a tuple with the ObjectItemsNullable field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NullableClass) GetObjectItemsNullableOk() (map[string]map[string]interface{}, bool) { + if o == nil || o.ObjectItemsNullable == nil { + var ret map[string]map[string]interface{} + return ret, false + } + return *o.ObjectItemsNullable, true +} + +// HasObjectItemsNullable returns a boolean if a field has been set. +func (o *NullableClass) HasObjectItemsNullable() bool { + if o != nil && o.ObjectItemsNullable != nil { + return true + } + + return false +} + +// SetObjectItemsNullable gets a reference to the given map[string]map[string]interface{} and assigns it to the ObjectItemsNullable field. +func (o *NullableClass) SetObjectItemsNullable(v map[string]map[string]interface{}) { + o.ObjectItemsNullable = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o NullableClass) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.IntegerProp == nil { + if o.isExplicitNullIntegerProp { + toSerialize["integer_prop"] = o.IntegerProp + } + } else { + toSerialize["integer_prop"] = o.IntegerProp + } + if o.NumberProp == nil { + if o.isExplicitNullNumberProp { + toSerialize["number_prop"] = o.NumberProp + } + } else { + toSerialize["number_prop"] = o.NumberProp + } + if o.BooleanProp == nil { + if o.isExplicitNullBooleanProp { + toSerialize["boolean_prop"] = o.BooleanProp + } + } else { + toSerialize["boolean_prop"] = o.BooleanProp + } + if o.StringProp == nil { + if o.isExplicitNullStringProp { + toSerialize["string_prop"] = o.StringProp + } + } else { + toSerialize["string_prop"] = o.StringProp + } + if o.DateProp == nil { + if o.isExplicitNullDateProp { + toSerialize["date_prop"] = o.DateProp + } + } else { + toSerialize["date_prop"] = o.DateProp + } + if o.DatetimeProp == nil { + if o.isExplicitNullDatetimeProp { + toSerialize["datetime_prop"] = o.DatetimeProp + } + } else { + toSerialize["datetime_prop"] = o.DatetimeProp + } + if o.ArrayNullableProp == nil { + if o.isExplicitNullArrayNullableProp { + toSerialize["array_nullable_prop"] = o.ArrayNullableProp + } + } else { + toSerialize["array_nullable_prop"] = o.ArrayNullableProp + } + if o.ArrayAndItemsNullableProp == nil { + if o.isExplicitNullArrayAndItemsNullableProp { + toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp + } + } else { + toSerialize["array_and_items_nullable_prop"] = o.ArrayAndItemsNullableProp + } + if o.ArrayItemsNullable != nil { + toSerialize["array_items_nullable"] = o.ArrayItemsNullable + } + if o.ObjectNullableProp == nil { + if o.isExplicitNullObjectNullableProp { + toSerialize["object_nullable_prop"] = o.ObjectNullableProp + } + } else { + toSerialize["object_nullable_prop"] = o.ObjectNullableProp + } + if o.ObjectAndItemsNullableProp == nil { + if o.isExplicitNullObjectAndItemsNullableProp { + toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp + } + } else { + toSerialize["object_and_items_nullable_prop"] = o.ObjectAndItemsNullableProp + } + if o.ObjectItemsNullable != nil { + toSerialize["object_items_nullable"] = o.ObjectItemsNullable + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go new file mode 100644 index 00000000000..5e6f7c74d99 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_number_only.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// NumberOnly struct for NumberOnly +type NumberOnly struct { + JustNumber *float32 `json:"JustNumber,omitempty"` + +} + +// GetJustNumber returns the JustNumber field if non-nil, zero value otherwise. +func (o *NumberOnly) GetJustNumber() float32 { + if o == nil || o.JustNumber == nil { + var ret float32 + return ret + } + return *o.JustNumber +} + +// GetJustNumberOk returns a tuple with the JustNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *NumberOnly) GetJustNumberOk() (float32, bool) { + if o == nil || o.JustNumber == nil { + var ret float32 + return ret, false + } + return *o.JustNumber, true +} + +// HasJustNumber returns a boolean if a field has been set. +func (o *NumberOnly) HasJustNumber() bool { + if o != nil && o.JustNumber != nil { + return true + } + + return false +} + +// SetJustNumber gets a reference to the given float32 and assigns it to the JustNumber field. +func (o *NumberOnly) SetJustNumber(v float32) { + o.JustNumber = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o NumberOnly) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.JustNumber != nil { + toSerialize["JustNumber"] = o.JustNumber + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go new file mode 100644 index 00000000000..a05ac01a884 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_order.go @@ -0,0 +1,255 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "time" + "encoding/json" +) +// Order struct for Order +type Order struct { + Id *int64 `json:"id,omitempty"` + + PetId *int64 `json:"petId,omitempty"` + + Quantity *int32 `json:"quantity,omitempty"` + + ShipDate *time.Time `json:"shipDate,omitempty"` + + // Order Status + Status *string `json:"status,omitempty"` + + Complete *bool `json:"complete,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Order) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Order) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Order) SetId(v int64) { + o.Id = &v +} + +// GetPetId returns the PetId field if non-nil, zero value otherwise. +func (o *Order) GetPetId() int64 { + if o == nil || o.PetId == nil { + var ret int64 + return ret + } + return *o.PetId +} + +// GetPetIdOk returns a tuple with the PetId field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetPetIdOk() (int64, bool) { + if o == nil || o.PetId == nil { + var ret int64 + return ret, false + } + return *o.PetId, true +} + +// HasPetId returns a boolean if a field has been set. +func (o *Order) HasPetId() bool { + if o != nil && o.PetId != nil { + return true + } + + return false +} + +// SetPetId gets a reference to the given int64 and assigns it to the PetId field. +func (o *Order) SetPetId(v int64) { + o.PetId = &v +} + +// GetQuantity returns the Quantity field if non-nil, zero value otherwise. +func (o *Order) GetQuantity() int32 { + if o == nil || o.Quantity == nil { + var ret int32 + return ret + } + return *o.Quantity +} + +// GetQuantityOk returns a tuple with the Quantity field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetQuantityOk() (int32, bool) { + if o == nil || o.Quantity == nil { + var ret int32 + return ret, false + } + return *o.Quantity, true +} + +// HasQuantity returns a boolean if a field has been set. +func (o *Order) HasQuantity() bool { + if o != nil && o.Quantity != nil { + return true + } + + return false +} + +// SetQuantity gets a reference to the given int32 and assigns it to the Quantity field. +func (o *Order) SetQuantity(v int32) { + o.Quantity = &v +} + +// GetShipDate returns the ShipDate field if non-nil, zero value otherwise. +func (o *Order) GetShipDate() time.Time { + if o == nil || o.ShipDate == nil { + var ret time.Time + return ret + } + return *o.ShipDate +} + +// GetShipDateOk returns a tuple with the ShipDate field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetShipDateOk() (time.Time, bool) { + if o == nil || o.ShipDate == nil { + var ret time.Time + return ret, false + } + return *o.ShipDate, true +} + +// HasShipDate returns a boolean if a field has been set. +func (o *Order) HasShipDate() bool { + if o != nil && o.ShipDate != nil { + return true + } + + return false +} + +// SetShipDate gets a reference to the given time.Time and assigns it to the ShipDate field. +func (o *Order) SetShipDate(v time.Time) { + o.ShipDate = &v +} + +// GetStatus returns the Status field if non-nil, zero value otherwise. +func (o *Order) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetStatusOk() (string, bool) { + if o == nil || o.Status == nil { + var ret string + return ret, false + } + return *o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Order) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Order) SetStatus(v string) { + o.Status = &v +} + +// GetComplete returns the Complete field if non-nil, zero value otherwise. +func (o *Order) GetComplete() bool { + if o == nil || o.Complete == nil { + var ret bool + return ret + } + return *o.Complete +} + +// GetCompleteOk returns a tuple with the Complete field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Order) GetCompleteOk() (bool, bool) { + if o == nil || o.Complete == nil { + var ret bool + return ret, false + } + return *o.Complete, true +} + +// HasComplete returns a boolean if a field has been set. +func (o *Order) HasComplete() bool { + if o != nil && o.Complete != nil { + return true + } + + return false +} + +// SetComplete gets a reference to the given bool and assigns it to the Complete field. +func (o *Order) SetComplete(v bool) { + o.Complete = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Order) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.PetId != nil { + toSerialize["petId"] = o.PetId + } + if o.Quantity != nil { + toSerialize["quantity"] = o.Quantity + } + if o.ShipDate != nil { + toSerialize["shipDate"] = o.ShipDate + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + if o.Complete != nil { + toSerialize["complete"] = o.Complete + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go new file mode 100644 index 00000000000..83c5d661eb2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_composite.go @@ -0,0 +1,139 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// OuterComposite struct for OuterComposite +type OuterComposite struct { + MyNumber *float32 `json:"my_number,omitempty"` + + MyString *string `json:"my_string,omitempty"` + + MyBoolean *bool `json:"my_boolean,omitempty"` + +} + +// GetMyNumber returns the MyNumber field if non-nil, zero value otherwise. +func (o *OuterComposite) GetMyNumber() float32 { + if o == nil || o.MyNumber == nil { + var ret float32 + return ret + } + return *o.MyNumber +} + +// GetMyNumberOk returns a tuple with the MyNumber field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyNumberOk() (float32, bool) { + if o == nil || o.MyNumber == nil { + var ret float32 + return ret, false + } + return *o.MyNumber, true +} + +// HasMyNumber returns a boolean if a field has been set. +func (o *OuterComposite) HasMyNumber() bool { + if o != nil && o.MyNumber != nil { + return true + } + + return false +} + +// SetMyNumber gets a reference to the given float32 and assigns it to the MyNumber field. +func (o *OuterComposite) SetMyNumber(v float32) { + o.MyNumber = &v +} + +// GetMyString returns the MyString field if non-nil, zero value otherwise. +func (o *OuterComposite) GetMyString() string { + if o == nil || o.MyString == nil { + var ret string + return ret + } + return *o.MyString +} + +// GetMyStringOk returns a tuple with the MyString field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyStringOk() (string, bool) { + if o == nil || o.MyString == nil { + var ret string + return ret, false + } + return *o.MyString, true +} + +// HasMyString returns a boolean if a field has been set. +func (o *OuterComposite) HasMyString() bool { + if o != nil && o.MyString != nil { + return true + } + + return false +} + +// SetMyString gets a reference to the given string and assigns it to the MyString field. +func (o *OuterComposite) SetMyString(v string) { + o.MyString = &v +} + +// GetMyBoolean returns the MyBoolean field if non-nil, zero value otherwise. +func (o *OuterComposite) GetMyBoolean() bool { + if o == nil || o.MyBoolean == nil { + var ret bool + return ret + } + return *o.MyBoolean +} + +// GetMyBooleanOk returns a tuple with the MyBoolean field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *OuterComposite) GetMyBooleanOk() (bool, bool) { + if o == nil || o.MyBoolean == nil { + var ret bool + return ret, false + } + return *o.MyBoolean, true +} + +// HasMyBoolean returns a boolean if a field has been set. +func (o *OuterComposite) HasMyBoolean() bool { + if o != nil && o.MyBoolean != nil { + return true + } + + return false +} + +// SetMyBoolean gets a reference to the given bool and assigns it to the MyBoolean field. +func (o *OuterComposite) SetMyBoolean(v bool) { + o.MyBoolean = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o OuterComposite) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.MyNumber != nil { + toSerialize["my_number"] = o.MyNumber + } + if o.MyString != nil { + toSerialize["my_string"] = o.MyString + } + if o.MyBoolean != nil { + toSerialize["my_boolean"] = o.MyBoolean + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go new file mode 100644 index 00000000000..e8299a160ec --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum.go @@ -0,0 +1,21 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +// OuterEnum the model 'OuterEnum' +type OuterEnum string + +// List of OuterEnum +const ( + PLACED OuterEnum = "placed" + APPROVED OuterEnum = "approved" + DELIVERED OuterEnum = "delivered" +) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go new file mode 100644 index 00000000000..d5f8a9a76fc --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_default_value.go @@ -0,0 +1,21 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +// OuterEnumDefaultValue the model 'OuterEnumDefaultValue' +type OuterEnumDefaultValue string + +// List of OuterEnumDefaultValue +const ( + PLACED OuterEnumDefaultValue = "placed" + APPROVED OuterEnumDefaultValue = "approved" + DELIVERED OuterEnumDefaultValue = "delivered" +) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go new file mode 100644 index 00000000000..2bdaee50144 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer.go @@ -0,0 +1,21 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +// OuterEnumInteger the model 'OuterEnumInteger' +type OuterEnumInteger int32 + +// List of OuterEnumInteger +const ( + _0 OuterEnumInteger = 0 + _1 OuterEnumInteger = 1 + _2 OuterEnumInteger = 2 +) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go new file mode 100644 index 00000000000..492dcc08bda --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_outer_enum_integer_default_value.go @@ -0,0 +1,21 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +// OuterEnumIntegerDefaultValue the model 'OuterEnumIntegerDefaultValue' +type OuterEnumIntegerDefaultValue int32 + +// List of OuterEnumIntegerDefaultValue +const ( + _0 OuterEnumIntegerDefaultValue = 0 + _1 OuterEnumIntegerDefaultValue = 1 + _2 OuterEnumIntegerDefaultValue = 2 +) + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go new file mode 100644 index 00000000000..1c7cde3b15d --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_pet.go @@ -0,0 +1,261 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" + "errors" +) +// Pet struct for Pet +type Pet struct { + Id *int64 `json:"id,omitempty"` + + Category *Category `json:"category,omitempty"` + + Name *string `json:"name,omitempty"` + + PhotoUrls *[]string `json:"photoUrls,omitempty"` + + Tags *[]Tag `json:"tags,omitempty"` + + // pet status in the store + Status *string `json:"status,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Pet) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Pet) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Pet) SetId(v int64) { + o.Id = &v +} + +// GetCategory returns the Category field if non-nil, zero value otherwise. +func (o *Pet) GetCategory() Category { + if o == nil || o.Category == nil { + var ret Category + return ret + } + return *o.Category +} + +// GetCategoryOk returns a tuple with the Category field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetCategoryOk() (Category, bool) { + if o == nil || o.Category == nil { + var ret Category + return ret, false + } + return *o.Category, true +} + +// HasCategory returns a boolean if a field has been set. +func (o *Pet) HasCategory() bool { + if o != nil && o.Category != nil { + return true + } + + return false +} + +// SetCategory gets a reference to the given Category and assigns it to the Category field. +func (o *Pet) SetCategory(v Category) { + o.Category = &v +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Pet) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Pet) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Pet) SetName(v string) { + o.Name = &v +} + +// GetPhotoUrls returns the PhotoUrls field if non-nil, zero value otherwise. +func (o *Pet) GetPhotoUrls() []string { + if o == nil || o.PhotoUrls == nil { + var ret []string + return ret + } + return *o.PhotoUrls +} + +// GetPhotoUrlsOk returns a tuple with the PhotoUrls field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetPhotoUrlsOk() ([]string, bool) { + if o == nil || o.PhotoUrls == nil { + var ret []string + return ret, false + } + return *o.PhotoUrls, true +} + +// HasPhotoUrls returns a boolean if a field has been set. +func (o *Pet) HasPhotoUrls() bool { + if o != nil && o.PhotoUrls != nil { + return true + } + + return false +} + +// SetPhotoUrls gets a reference to the given []string and assigns it to the PhotoUrls field. +func (o *Pet) SetPhotoUrls(v []string) { + o.PhotoUrls = &v +} + +// GetTags returns the Tags field if non-nil, zero value otherwise. +func (o *Pet) GetTags() []Tag { + if o == nil || o.Tags == nil { + var ret []Tag + return ret + } + return *o.Tags +} + +// GetTagsOk returns a tuple with the Tags field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetTagsOk() ([]Tag, bool) { + if o == nil || o.Tags == nil { + var ret []Tag + return ret, false + } + return *o.Tags, true +} + +// HasTags returns a boolean if a field has been set. +func (o *Pet) HasTags() bool { + if o != nil && o.Tags != nil { + return true + } + + return false +} + +// SetTags gets a reference to the given []Tag and assigns it to the Tags field. +func (o *Pet) SetTags(v []Tag) { + o.Tags = &v +} + +// GetStatus returns the Status field if non-nil, zero value otherwise. +func (o *Pet) GetStatus() string { + if o == nil || o.Status == nil { + var ret string + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Pet) GetStatusOk() (string, bool) { + if o == nil || o.Status == nil { + var ret string + return ret, false + } + return *o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *Pet) HasStatus() bool { + if o != nil && o.Status != nil { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *Pet) SetStatus(v string) { + o.Status = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Pet) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Category != nil { + toSerialize["category"] = o.Category + } + if o.Name == nil { + return nil, errors.New("Name is required and not nullable, but was not set on Pet") + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + if o.PhotoUrls == nil { + return nil, errors.New("PhotoUrls is required and not nullable, but was not set on Pet") + } + if o.PhotoUrls != nil { + toSerialize["photoUrls"] = o.PhotoUrls + } + if o.Tags != nil { + toSerialize["tags"] = o.Tags + } + if o.Status != nil { + toSerialize["status"] = o.Status + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go new file mode 100644 index 00000000000..3035cc15e51 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_read_only_first.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// ReadOnlyFirst struct for ReadOnlyFirst +type ReadOnlyFirst struct { + Bar *string `json:"bar,omitempty"` + + Baz *string `json:"baz,omitempty"` + +} + +// GetBar returns the Bar field if non-nil, zero value otherwise. +func (o *ReadOnlyFirst) GetBar() string { + if o == nil || o.Bar == nil { + var ret string + return ret + } + return *o.Bar +} + +// GetBarOk returns a tuple with the Bar field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBarOk() (string, bool) { + if o == nil || o.Bar == nil { + var ret string + return ret, false + } + return *o.Bar, true +} + +// HasBar returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBar() bool { + if o != nil && o.Bar != nil { + return true + } + + return false +} + +// SetBar gets a reference to the given string and assigns it to the Bar field. +func (o *ReadOnlyFirst) SetBar(v string) { + o.Bar = &v +} + +// GetBaz returns the Baz field if non-nil, zero value otherwise. +func (o *ReadOnlyFirst) GetBaz() string { + if o == nil || o.Baz == nil { + var ret string + return ret + } + return *o.Baz +} + +// GetBazOk returns a tuple with the Baz field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *ReadOnlyFirst) GetBazOk() (string, bool) { + if o == nil || o.Baz == nil { + var ret string + return ret, false + } + return *o.Baz, true +} + +// HasBaz returns a boolean if a field has been set. +func (o *ReadOnlyFirst) HasBaz() bool { + if o != nil && o.Baz != nil { + return true + } + + return false +} + +// SetBaz gets a reference to the given string and assigns it to the Baz field. +func (o *ReadOnlyFirst) SetBaz(v string) { + o.Baz = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o ReadOnlyFirst) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Bar != nil { + toSerialize["bar"] = o.Bar + } + if o.Baz != nil { + toSerialize["baz"] = o.Baz + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go new file mode 100644 index 00000000000..fcf674e31ca --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_return.go @@ -0,0 +1,63 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// Return Model for testing reserved words +type Return struct { + Return *int32 `json:"return,omitempty"` + +} + +// GetReturn returns the Return field if non-nil, zero value otherwise. +func (o *Return) GetReturn() int32 { + if o == nil || o.Return == nil { + var ret int32 + return ret + } + return *o.Return +} + +// GetReturnOk returns a tuple with the Return field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Return) GetReturnOk() (int32, bool) { + if o == nil || o.Return == nil { + var ret int32 + return ret, false + } + return *o.Return, true +} + +// HasReturn returns a boolean if a field has been set. +func (o *Return) HasReturn() bool { + if o != nil && o.Return != nil { + return true + } + + return false +} + +// SetReturn gets a reference to the given int32 and assigns it to the Return field. +func (o *Return) SetReturn(v int32) { + o.Return = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Return) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Return != nil { + toSerialize["return"] = o.Return + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go new file mode 100644 index 00000000000..c75f4762e87 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_tag.go @@ -0,0 +1,101 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// Tag struct for Tag +type Tag struct { + Id *int64 `json:"id,omitempty"` + + Name *string `json:"name,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *Tag) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *Tag) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *Tag) SetId(v int64) { + o.Id = &v +} + +// GetName returns the Name field if non-nil, zero value otherwise. +func (o *Tag) GetName() string { + if o == nil || o.Name == nil { + var ret string + return ret + } + return *o.Name +} + +// GetNameOk returns a tuple with the Name field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *Tag) GetNameOk() (string, bool) { + if o == nil || o.Name == nil { + var ret string + return ret, false + } + return *o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *Tag) HasName() bool { + if o != nil && o.Name != nil { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *Tag) SetName(v string) { + o.Name = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o Tag) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Name != nil { + toSerialize["name"] = o.Name + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go new file mode 100644 index 00000000000..b07841354bf --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/model_user.go @@ -0,0 +1,330 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi +import ( + "encoding/json" +) +// User struct for User +type User struct { + Id *int64 `json:"id,omitempty"` + + Username *string `json:"username,omitempty"` + + FirstName *string `json:"firstName,omitempty"` + + LastName *string `json:"lastName,omitempty"` + + Email *string `json:"email,omitempty"` + + Password *string `json:"password,omitempty"` + + Phone *string `json:"phone,omitempty"` + + // User Status + UserStatus *int32 `json:"userStatus,omitempty"` + +} + +// GetId returns the Id field if non-nil, zero value otherwise. +func (o *User) GetId() int64 { + if o == nil || o.Id == nil { + var ret int64 + return ret + } + return *o.Id +} + +// GetIdOk returns a tuple with the Id field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetIdOk() (int64, bool) { + if o == nil || o.Id == nil { + var ret int64 + return ret, false + } + return *o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *User) HasId() bool { + if o != nil && o.Id != nil { + return true + } + + return false +} + +// SetId gets a reference to the given int64 and assigns it to the Id field. +func (o *User) SetId(v int64) { + o.Id = &v +} + +// GetUsername returns the Username field if non-nil, zero value otherwise. +func (o *User) GetUsername() string { + if o == nil || o.Username == nil { + var ret string + return ret + } + return *o.Username +} + +// GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUsernameOk() (string, bool) { + if o == nil || o.Username == nil { + var ret string + return ret, false + } + return *o.Username, true +} + +// HasUsername returns a boolean if a field has been set. +func (o *User) HasUsername() bool { + if o != nil && o.Username != nil { + return true + } + + return false +} + +// SetUsername gets a reference to the given string and assigns it to the Username field. +func (o *User) SetUsername(v string) { + o.Username = &v +} + +// GetFirstName returns the FirstName field if non-nil, zero value otherwise. +func (o *User) GetFirstName() string { + if o == nil || o.FirstName == nil { + var ret string + return ret + } + return *o.FirstName +} + +// GetFirstNameOk returns a tuple with the FirstName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetFirstNameOk() (string, bool) { + if o == nil || o.FirstName == nil { + var ret string + return ret, false + } + return *o.FirstName, true +} + +// HasFirstName returns a boolean if a field has been set. +func (o *User) HasFirstName() bool { + if o != nil && o.FirstName != nil { + return true + } + + return false +} + +// SetFirstName gets a reference to the given string and assigns it to the FirstName field. +func (o *User) SetFirstName(v string) { + o.FirstName = &v +} + +// GetLastName returns the LastName field if non-nil, zero value otherwise. +func (o *User) GetLastName() string { + if o == nil || o.LastName == nil { + var ret string + return ret + } + return *o.LastName +} + +// GetLastNameOk returns a tuple with the LastName field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetLastNameOk() (string, bool) { + if o == nil || o.LastName == nil { + var ret string + return ret, false + } + return *o.LastName, true +} + +// HasLastName returns a boolean if a field has been set. +func (o *User) HasLastName() bool { + if o != nil && o.LastName != nil { + return true + } + + return false +} + +// SetLastName gets a reference to the given string and assigns it to the LastName field. +func (o *User) SetLastName(v string) { + o.LastName = &v +} + +// GetEmail returns the Email field if non-nil, zero value otherwise. +func (o *User) GetEmail() string { + if o == nil || o.Email == nil { + var ret string + return ret + } + return *o.Email +} + +// GetEmailOk returns a tuple with the Email field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetEmailOk() (string, bool) { + if o == nil || o.Email == nil { + var ret string + return ret, false + } + return *o.Email, true +} + +// HasEmail returns a boolean if a field has been set. +func (o *User) HasEmail() bool { + if o != nil && o.Email != nil { + return true + } + + return false +} + +// SetEmail gets a reference to the given string and assigns it to the Email field. +func (o *User) SetEmail(v string) { + o.Email = &v +} + +// GetPassword returns the Password field if non-nil, zero value otherwise. +func (o *User) GetPassword() string { + if o == nil || o.Password == nil { + var ret string + return ret + } + return *o.Password +} + +// GetPasswordOk returns a tuple with the Password field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPasswordOk() (string, bool) { + if o == nil || o.Password == nil { + var ret string + return ret, false + } + return *o.Password, true +} + +// HasPassword returns a boolean if a field has been set. +func (o *User) HasPassword() bool { + if o != nil && o.Password != nil { + return true + } + + return false +} + +// SetPassword gets a reference to the given string and assigns it to the Password field. +func (o *User) SetPassword(v string) { + o.Password = &v +} + +// GetPhone returns the Phone field if non-nil, zero value otherwise. +func (o *User) GetPhone() string { + if o == nil || o.Phone == nil { + var ret string + return ret + } + return *o.Phone +} + +// GetPhoneOk returns a tuple with the Phone field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetPhoneOk() (string, bool) { + if o == nil || o.Phone == nil { + var ret string + return ret, false + } + return *o.Phone, true +} + +// HasPhone returns a boolean if a field has been set. +func (o *User) HasPhone() bool { + if o != nil && o.Phone != nil { + return true + } + + return false +} + +// SetPhone gets a reference to the given string and assigns it to the Phone field. +func (o *User) SetPhone(v string) { + o.Phone = &v +} + +// GetUserStatus returns the UserStatus field if non-nil, zero value otherwise. +func (o *User) GetUserStatus() int32 { + if o == nil || o.UserStatus == nil { + var ret int32 + return ret + } + return *o.UserStatus +} + +// GetUserStatusOk returns a tuple with the UserStatus field if it's non-nil, zero value otherwise +// and a boolean to check if the value has been set. +func (o *User) GetUserStatusOk() (int32, bool) { + if o == nil || o.UserStatus == nil { + var ret int32 + return ret, false + } + return *o.UserStatus, true +} + +// HasUserStatus returns a boolean if a field has been set. +func (o *User) HasUserStatus() bool { + if o != nil && o.UserStatus != nil { + return true + } + + return false +} + +// SetUserStatus gets a reference to the given int32 and assigns it to the UserStatus field. +func (o *User) SetUserStatus(v int32) { + o.UserStatus = &v +} + + +// MarshalJSON returns the JSON representation of the model. +func (o User) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.Id != nil { + toSerialize["id"] = o.Id + } + if o.Username != nil { + toSerialize["username"] = o.Username + } + if o.FirstName != nil { + toSerialize["firstName"] = o.FirstName + } + if o.LastName != nil { + toSerialize["lastName"] = o.LastName + } + if o.Email != nil { + toSerialize["email"] = o.Email + } + if o.Password != nil { + toSerialize["password"] = o.Password + } + if o.Phone != nil { + toSerialize["phone"] = o.Phone + } + if o.UserStatus != nil { + toSerialize["userStatus"] = o.UserStatus + } + return json.Marshal(toSerialize) +} + + diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go new file mode 100644 index 00000000000..77346c8c1e3 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/response.go @@ -0,0 +1,46 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResonse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go b/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go new file mode 100644 index 00000000000..f5916b755a2 --- /dev/null +++ b/samples/openapi3/client/petstore/go-experimental/go-petstore/utils.go @@ -0,0 +1,39 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package openapi + +import "time" + +// PtrBool is a helper routine that returns a pointer to given integer value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat is a helper routine that returns a pointer to given float value. +func PtrFloat(v float32) *float32 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } \ No newline at end of file diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go index 406d2aa670d..bae14df0f7d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer.go @@ -13,7 +13,7 @@ type OuterEnumInteger int32 // List of OuterEnumInteger const ( - _0 OuterEnumInteger = "0" - _1 OuterEnumInteger = "1" - _2 OuterEnumInteger = "2" + _0 OuterEnumInteger = 0 + _1 OuterEnumInteger = 1 + _2 OuterEnumInteger = 2 ) diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go index 3a6b54a261b..b882d7aee2c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_outer_enum_integer_default_value.go @@ -13,7 +13,7 @@ type OuterEnumIntegerDefaultValue int32 // List of OuterEnumIntegerDefaultValue const ( - _0 OuterEnumIntegerDefaultValue = "0" - _1 OuterEnumIntegerDefaultValue = "1" - _2 OuterEnumIntegerDefaultValue = "2" + _0 OuterEnumIntegerDefaultValue = 0 + _1 OuterEnumIntegerDefaultValue = 1 + _2 OuterEnumIntegerDefaultValue = 2 ) diff --git a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION index afa63656064..c3a2c7076fa 100644 --- a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-api-server/go/README.md b/samples/openapi3/server/petstore/go-api-server/README.md similarity index 100% rename from samples/openapi3/server/petstore/go-api-server/go/README.md rename to samples/openapi3/server/petstore/go-api-server/README.md diff --git a/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml b/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml index 2cd94b385f3..c5e930efc56 100644 --- a/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml @@ -130,7 +130,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -350,7 +351,8 @@ paths: - store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -370,7 +372,8 @@ paths: tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -604,7 +607,6 @@ paths: name: required_string_group required: true schema: - format: int32 type: integer style: form - description: Required Boolean in group parameters @@ -630,7 +632,6 @@ paths: name: string_group required: false schema: - format: int32 type: integer style: form - description: Boolean in group parameters @@ -803,7 +804,6 @@ paths: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1045,7 +1045,8 @@ paths: - $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1058,6 +1059,61 @@ paths: description: Success tags: - fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1368,7 +1424,6 @@ components: property: type: string 123Number: - format: int32 readOnly: true type: integer required: @@ -1393,17 +1448,11 @@ components: Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object + - $ref: '#/components/schemas/Dog_allOf' Cat: allOf: - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object + - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: propertyName: className @@ -1423,7 +1472,6 @@ components: format_test: properties: integer: - format: int32 maximum: 100 minimum: 10 type: integer @@ -1478,7 +1526,8 @@ components: pattern: ^\d{10}$ type: string pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. pattern: /^image_\d{1,3}$/i type: string required: @@ -1625,6 +1674,7 @@ components: indirect_map: additionalProperties: type: boolean + type: object type: object ArrayTest: properties: @@ -1687,13 +1737,13 @@ components: - placed - approved - delivered + nullable: true type: string OuterEnumInteger: enum: - 0 - 1 - 2 - format: int32 type: integer OuterEnumDefaultValue: default: placed @@ -1708,7 +1758,6 @@ components: - 0 - 1 - 2 - format: int32 type: integer OuterComposite: example: @@ -1734,6 +1783,7 @@ components: StringBooleanMap: additionalProperties: type: boolean + type: object FileSchemaTestClass: example: file: @@ -1766,7 +1816,8 @@ components: xml: name: $special[model.name] HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. example: NullableMessage: NullableMessage properties: @@ -1774,6 +1825,64 @@ components: nullable: true type: string type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object inline_response_default: example: string: @@ -1824,7 +1933,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1917,6 +2025,14 @@ components: required: - requiredFile type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_fake.go b/samples/openapi3/server/petstore/go-api-server/go/api_fake.go index 6ac1fa43554..07ebda735bd 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/api_fake.go +++ b/samples/openapi3/server/petstore/go-api-server/go/api_fake.go @@ -90,3 +90,9 @@ func TestJsonFormData(w http.ResponseWriter, r *http.Request) { w.Header().Set("Content-Type", "application/json; charset=UTF-8") w.WriteHeader(http.StatusOK) } + +// TestQueryParameterCollectionFormat - +func TestQueryParameterCollectionFormat(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) +} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go b/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go new file mode 100644 index 00000000000..312c33895f8 --- /dev/null +++ b/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package petstoreserver + +type CatAllOf struct { + + Declawed bool `json:"declawed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go b/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go new file mode 100644 index 00000000000..a36b96b1a0c --- /dev/null +++ b/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package petstoreserver + +type DogAllOf struct { + + Breed string `json:"breed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go b/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go index 01b52e667f4..7822fd4e9d4 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go +++ b/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go @@ -19,7 +19,7 @@ type EnumTest struct { EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go new file mode 100644 index 00000000000..ba2aa1f86cf --- /dev/null +++ b/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package petstoreserver + +import ( + "time" +) + +type NullableClass struct { + + IntegerProp *int32 `json:"integer_prop,omitempty"` + + NumberProp *float32 `json:"number_prop,omitempty"` + + BooleanProp *bool `json:"boolean_prop,omitempty"` + + StringProp *string `json:"string_prop,omitempty"` + + DateProp *string `json:"date_prop,omitempty"` + + DatetimeProp *time.Time `json:"datetime_prop,omitempty"` + + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + + ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` + + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + + ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go index de396966843..f14b13342af 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go +++ b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go @@ -13,7 +13,7 @@ type OuterEnumInteger int32 // List of OuterEnumInteger const ( - _0 OuterEnumInteger = "0" - _1 OuterEnumInteger = "1" - _2 OuterEnumInteger = "2" + _0 OuterEnumInteger = 0 + _1 OuterEnumInteger = 1 + _2 OuterEnumInteger = 2 ) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go index 2e4dc213ea2..94b4bb2077a 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go @@ -13,7 +13,7 @@ type OuterEnumIntegerDefaultValue int32 // List of OuterEnumIntegerDefaultValue const ( - _0 OuterEnumIntegerDefaultValue = "0" - _1 OuterEnumIntegerDefaultValue = "1" - _2 OuterEnumIntegerDefaultValue = "2" + _0 OuterEnumIntegerDefaultValue = 0 + _1 OuterEnumIntegerDefaultValue = 1 + _2 OuterEnumIntegerDefaultValue = 2 ) diff --git a/samples/openapi3/server/petstore/go-api-server/go/routers.go b/samples/openapi3/server/petstore/go-api-server/go/routers.go index 215c2ba072a..616ae81843d 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/routers.go +++ b/samples/openapi3/server/petstore/go-api-server/go/routers.go @@ -160,6 +160,13 @@ var routes = Routes{ TestJsonFormData, }, + { + "TestQueryParameterCollectionFormat", + strings.ToUpper("Put"), + "/v2/fake/test-query-paramters", + TestQueryParameterCollectionFormat, + }, + { "TestClassname", strings.ToUpper("Patch"), diff --git a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION index afa63656064..c3a2c7076fa 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.0.0-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml index 2cd94b385f3..c5e930efc56 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml +++ b/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml @@ -130,7 +130,8 @@ paths: /pet/findByTags: get: deprecated: true - description: Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + description: Multiple tags can be provided with comma separated strings. Use + tag1, tag2, tag3 for testing. operationId: findPetsByTags parameters: - description: Tags to filter by @@ -350,7 +351,8 @@ paths: - store /store/order/{order_id}: delete: - description: For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors + description: For valid response try integer IDs with value < 1000. Anything + above 1000 or nonintegers will generate API errors operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted @@ -370,7 +372,8 @@ paths: tags: - store get: - description: For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + description: For valid response try integer IDs with value <= 5 or > 10. Other + values will generated exceptions operationId: getOrderById parameters: - description: ID of pet that needs to be fetched @@ -604,7 +607,6 @@ paths: name: required_string_group required: true schema: - format: int32 type: integer style: form - description: Required Boolean in group parameters @@ -630,7 +632,6 @@ paths: name: string_group required: false schema: - format: int32 type: integer style: form - description: Boolean in group parameters @@ -803,7 +804,6 @@ paths: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1045,7 +1045,8 @@ paths: - $another-fake? /fake/body-with-file-schema: put: - description: For this test, the body for this request much reference a schema named `File`. + description: For this test, the body for this request much reference a schema + named `File`. operationId: testBodyWithFileSchema requestBody: content: @@ -1058,6 +1059,61 @@ paths: description: Success tags: - fake + /fake/test-query-paramters: + put: + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - explode: true + in: query + name: pipe + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: ioutil + required: true + schema: + items: + type: string + type: array + style: form + - explode: false + in: query + name: http + required: true + schema: + items: + type: string + type: array + style: spaceDelimited + - explode: false + in: query + name: url + required: true + schema: + items: + type: string + type: array + style: form + - explode: true + in: query + name: context + required: true + schema: + items: + type: string + type: array + style: form + responses: + 200: + description: Success + tags: + - fake /fake/{petId}/uploadImageWithRequiredFile: post: operationId: uploadFileWithRequiredFile @@ -1368,7 +1424,6 @@ components: property: type: string 123Number: - format: int32 readOnly: true type: integer required: @@ -1393,17 +1448,11 @@ components: Dog: allOf: - $ref: '#/components/schemas/Animal' - - properties: - breed: - type: string - type: object + - $ref: '#/components/schemas/Dog_allOf' Cat: allOf: - $ref: '#/components/schemas/Animal' - - properties: - declawed: - type: boolean - type: object + - $ref: '#/components/schemas/Cat_allOf' Animal: discriminator: propertyName: className @@ -1423,7 +1472,6 @@ components: format_test: properties: integer: - format: int32 maximum: 100 minimum: 10 type: integer @@ -1478,7 +1526,8 @@ components: pattern: ^\d{10}$ type: string pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. pattern: /^image_\d{1,3}$/i type: string required: @@ -1625,6 +1674,7 @@ components: indirect_map: additionalProperties: type: boolean + type: object type: object ArrayTest: properties: @@ -1687,13 +1737,13 @@ components: - placed - approved - delivered + nullable: true type: string OuterEnumInteger: enum: - 0 - 1 - 2 - format: int32 type: integer OuterEnumDefaultValue: default: placed @@ -1708,7 +1758,6 @@ components: - 0 - 1 - 2 - format: int32 type: integer OuterComposite: example: @@ -1734,6 +1783,7 @@ components: StringBooleanMap: additionalProperties: type: boolean + type: object FileSchemaTestClass: example: file: @@ -1766,7 +1816,8 @@ components: xml: name: $special[model.name] HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. example: NullableMessage: NullableMessage properties: @@ -1774,6 +1825,64 @@ components: nullable: true type: string type: object + NullableClass: + additionalProperties: + nullable: true + type: object + properties: + integer_prop: + nullable: true + type: integer + number_prop: + nullable: true + type: number + boolean_prop: + nullable: true + type: boolean + string_prop: + nullable: true + type: string + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: + items: + type: object + nullable: true + type: array + array_and_items_nullable_prop: + items: + nullable: true + type: object + nullable: true + type: array + array_items_nullable: + items: + nullable: true + type: object + type: array + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object inline_response_default: example: string: @@ -1824,7 +1933,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -1917,6 +2025,14 @@ components: required: - requiredFile type: object + Dog_allOf: + properties: + breed: + type: string + Cat_allOf: + properties: + declawed: + type: boolean securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go index ec2f170ad53..17107d021c5 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go @@ -79,3 +79,8 @@ func TestInlineAdditionalProperties(c *gin.Context) { func TestJsonFormData(c *gin.Context) { c.JSON(http.StatusOK, gin.H{}) } + +// TestQueryParameterCollectionFormat - +func TestQueryParameterCollectionFormat(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{}) +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go new file mode 100644 index 00000000000..312c33895f8 --- /dev/null +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package petstoreserver + +type CatAllOf struct { + + Declawed bool `json:"declawed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go new file mode 100644 index 00000000000..a36b96b1a0c --- /dev/null +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go @@ -0,0 +1,15 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package petstoreserver + +type DogAllOf struct { + + Breed string `json:"breed,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go index 01b52e667f4..7822fd4e9d4 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go @@ -19,7 +19,7 @@ type EnumTest struct { EnumNumber float64 `json:"enum_number,omitempty"` - OuterEnum OuterEnum `json:"outerEnum,omitempty"` + OuterEnum *OuterEnum `json:"outerEnum,omitempty"` OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go new file mode 100644 index 00000000000..ba2aa1f86cf --- /dev/null +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go @@ -0,0 +1,41 @@ +/* + * OpenAPI Petstore + * + * 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) + */ + +package petstoreserver + +import ( + "time" +) + +type NullableClass struct { + + IntegerProp *int32 `json:"integer_prop,omitempty"` + + NumberProp *float32 `json:"number_prop,omitempty"` + + BooleanProp *bool `json:"boolean_prop,omitempty"` + + StringProp *string `json:"string_prop,omitempty"` + + DateProp *string `json:"date_prop,omitempty"` + + DatetimeProp *time.Time `json:"datetime_prop,omitempty"` + + ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` + + ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` + + ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` + + ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` + + ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` + + ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` +} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go index de396966843..f14b13342af 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go @@ -13,7 +13,7 @@ type OuterEnumInteger int32 // List of OuterEnumInteger const ( - _0 OuterEnumInteger = "0" - _1 OuterEnumInteger = "1" - _2 OuterEnumInteger = "2" + _0 OuterEnumInteger = 0 + _1 OuterEnumInteger = 1 + _2 OuterEnumInteger = 2 ) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go index 2e4dc213ea2..94b4bb2077a 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go @@ -13,7 +13,7 @@ type OuterEnumIntegerDefaultValue int32 // List of OuterEnumIntegerDefaultValue const ( - _0 OuterEnumIntegerDefaultValue = "0" - _1 OuterEnumIntegerDefaultValue = "1" - _2 OuterEnumIntegerDefaultValue = "2" + _0 OuterEnumIntegerDefaultValue = 0 + _1 OuterEnumIntegerDefaultValue = 1 + _2 OuterEnumIntegerDefaultValue = 2 ) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go b/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go index fd73305ca41..4d05d282f98 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go +++ b/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go @@ -11,7 +11,6 @@ package petstoreserver import ( "net/http" - "strings" "github.com/gin-gonic/gin" ) @@ -36,13 +35,13 @@ func NewRouter() *gin.Engine { router := gin.Default() for _, route := range routes { switch route.Method { - case "GET": + case http.MethodGet: router.GET(route.Pattern, route.HandlerFunc) - case "POST": + case http.MethodPost: router.POST(route.Pattern, route.HandlerFunc) - case "PUT": + case http.MethodPut: router.PUT(route.Pattern, route.HandlerFunc) - case "DELETE": + case http.MethodDelete: router.DELETE(route.Pattern, route.HandlerFunc) } } @@ -58,266 +57,273 @@ func Index(c *gin.Context) { var routes = Routes{ { "Index", - "GET", + http.MethodGet, "/v2/", Index, }, { "Call123TestSpecialTags", - strings.ToUpper("Patch"), + http.MethodPatch, "/v2/another-fake/dummy", Call123TestSpecialTags, }, { "FooGet", - strings.ToUpper("Get"), + http.MethodGet, "/v2/foo", FooGet, }, { "FakeHealthGet", - strings.ToUpper("Get"), + http.MethodGet, "/v2/fake/health", FakeHealthGet, }, { "FakeOuterBooleanSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/boolean", FakeOuterBooleanSerialize, }, { "FakeOuterCompositeSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/composite", FakeOuterCompositeSerialize, }, { "FakeOuterNumberSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/number", FakeOuterNumberSerialize, }, { "FakeOuterStringSerialize", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/outer/string", FakeOuterStringSerialize, }, { "TestBodyWithFileSchema", - strings.ToUpper("Put"), + http.MethodPut, "/v2/fake/body-with-file-schema", TestBodyWithFileSchema, }, { "TestBodyWithQueryParams", - strings.ToUpper("Put"), + http.MethodPut, "/v2/fake/body-with-query-params", TestBodyWithQueryParams, }, { "TestClientModel", - strings.ToUpper("Patch"), + http.MethodPatch, "/v2/fake", TestClientModel, }, { "TestEndpointParameters", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake", TestEndpointParameters, }, { "TestEnumParameters", - strings.ToUpper("Get"), + http.MethodGet, "/v2/fake", TestEnumParameters, }, { "TestGroupParameters", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/fake", TestGroupParameters, }, { "TestInlineAdditionalProperties", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/inline-additionalProperties", TestInlineAdditionalProperties, }, { "TestJsonFormData", - strings.ToUpper("Get"), + http.MethodGet, "/v2/fake/jsonFormData", TestJsonFormData, }, + { + "TestQueryParameterCollectionFormat", + http.MethodPut, + "/v2/fake/test-query-paramters", + TestQueryParameterCollectionFormat, + }, + { "TestClassname", - strings.ToUpper("Patch"), + http.MethodPatch, "/v2/fake_classname_test", TestClassname, }, { "AddPet", - strings.ToUpper("Post"), + http.MethodPost, "/v2/pet", AddPet, }, { "DeletePet", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/pet/:petId", DeletePet, }, { "FindPetsByStatus", - strings.ToUpper("Get"), + http.MethodGet, "/v2/pet/findByStatus", FindPetsByStatus, }, { "FindPetsByTags", - strings.ToUpper("Get"), + http.MethodGet, "/v2/pet/findByTags", FindPetsByTags, }, { "GetPetById", - strings.ToUpper("Get"), + http.MethodGet, "/v2/pet/:petId", GetPetById, }, { "UpdatePet", - strings.ToUpper("Put"), + http.MethodPut, "/v2/pet", UpdatePet, }, { "UpdatePetWithForm", - strings.ToUpper("Post"), + http.MethodPost, "/v2/pet/:petId", UpdatePetWithForm, }, { "UploadFile", - strings.ToUpper("Post"), + http.MethodPost, "/v2/pet/:petId/uploadImage", UploadFile, }, { "UploadFileWithRequiredFile", - strings.ToUpper("Post"), + http.MethodPost, "/v2/fake/:petId/uploadImageWithRequiredFile", UploadFileWithRequiredFile, }, { "DeleteOrder", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/store/order/:order_id", DeleteOrder, }, { "GetInventory", - strings.ToUpper("Get"), + http.MethodGet, "/v2/store/inventory", GetInventory, }, { "GetOrderById", - strings.ToUpper("Get"), + http.MethodGet, "/v2/store/order/:order_id", GetOrderById, }, { "PlaceOrder", - strings.ToUpper("Post"), + http.MethodPost, "/v2/store/order", PlaceOrder, }, { "CreateUser", - strings.ToUpper("Post"), + http.MethodPost, "/v2/user", CreateUser, }, { "CreateUsersWithArrayInput", - strings.ToUpper("Post"), + http.MethodPost, "/v2/user/createWithArray", CreateUsersWithArrayInput, }, { "CreateUsersWithListInput", - strings.ToUpper("Post"), + http.MethodPost, "/v2/user/createWithList", CreateUsersWithListInput, }, { "DeleteUser", - strings.ToUpper("Delete"), + http.MethodDelete, "/v2/user/:username", DeleteUser, }, { "GetUserByName", - strings.ToUpper("Get"), + http.MethodGet, "/v2/user/:username", GetUserByName, }, { "LoginUser", - strings.ToUpper("Get"), + http.MethodGet, "/v2/user/login", LoginUser, }, { "LogoutUser", - strings.ToUpper("Get"), + http.MethodGet, "/v2/user/logout", LogoutUser, }, { "UpdateUser", - strings.ToUpper("Put"), + http.MethodPut, "/v2/user/:username", UpdateUser, }, diff --git a/samples/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/server/petstore/go-api-server/.openapi-generator/VERSION index 0e97bd19efb..c3a2c7076fa 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/VERSION +++ b/samples/server/petstore/go-api-server/.openapi-generator/VERSION @@ -1 +1 @@ -4.1.3-SNAPSHOT \ No newline at end of file +4.2.0-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/go/README.md b/samples/server/petstore/go-api-server/go/README.md deleted file mode 100644 index fbcf4ae661b..00000000000 --- a/samples/server/petstore/go-api-server/go/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Go API Server for petstoreserver - -This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - -## Overview -This server was generated by the [openapi-generator] -(https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. -- - -To see how to make this your own, look here: - -[README](https://openapi-generator.tech) - -- API version: 1.0.0 - - -### Running the server -To run the server, follow these simple steps: - -``` -go run main.go -``` - -To run the server in a docker container -``` -docker build --network=host -t petstoreserver . -``` - -Once image is built use -``` -docker run --rm -it petstoreserver -``` - - diff --git a/samples/server/petstore/go-api-server/go/model_inline_object.go b/samples/server/petstore/go-api-server/go/model_inline_object.go deleted file mode 100644 index ee13c18c29a..00000000000 --- a/samples/server/petstore/go-api-server/go/model_inline_object.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineObject struct { - - // Updated name of the pet - Name string `json:"name,omitempty"` - - // Updated status of the pet - Status string `json:"status,omitempty"` -} diff --git a/samples/server/petstore/go-api-server/go/model_inline_object_1.go b/samples/server/petstore/go-api-server/go/model_inline_object_1.go deleted file mode 100644 index a41e0bff7d9..00000000000 --- a/samples/server/petstore/go-api-server/go/model_inline_object_1.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" -) - -type InlineObject1 struct { - - // Additional data to pass to server - AdditionalMetadata string `json:"additionalMetadata,omitempty"` - - // file to upload - File **os.File `json:"file,omitempty"` -}