From 004c7e8c8d41d6bcaca8a8dd88b4d7a94d542f95 Mon Sep 17 00:00:00 2001 From: TAKAHiRO TOMiNAGA <52474650+kokoichi206@users.noreply.github.com> Date: Sun, 10 Dec 2023 11:13:49 +0900 Subject: [PATCH] [Style][Go] standardize the format of mustache (tiny change) (#17363) * fix: change indent style to tab in the mustache to generate Go code * docs: standardize the language names for code blocks * docs: change indent style to tab in the code blocks * update: regenerate samples * `./bin/generate-samples.sh ./bin/configs/*.yaml` --- .../resources/go-echo-server/api.mustache | 14 +- .../go-echo-server/handler-container.mustache | 6 +- .../go-echo-server/hello-world.mustache | 4 +- .../resources/go-echo-server/main.mustache | 4 +- .../src/main/resources/go/README.mustache | 28 +- .../src/main/resources/go/api_doc.mustache | 38 +- .../main/resources/go/model_simple.mustache | 2 +- samples/client/echo_api/go/README.md | 20 +- samples/client/echo_api/go/docs/AuthAPI.md | 52 +- samples/client/echo_api/go/docs/BodyAPI.md | 236 ++++---- samples/client/echo_api/go/docs/FormAPI.md | 74 +-- samples/client/echo_api/go/docs/HeaderAPI.md | 38 +- samples/client/echo_api/go/docs/PathAPI.md | 36 +- samples/client/echo_api/go/docs/QueryAPI.md | 250 ++++---- samples/client/echo_api/go/model_pet.go | 2 +- .../client/petstore/go/go-petstore/README.md | 26 +- .../go/go-petstore/docs/AnotherFakeAPI.md | 32 +- .../petstore/go/go-petstore/docs/FakeAPI.md | 446 +++++++------- .../docs/FakeClassnameTags123API.md | 30 +- .../petstore/go/go-petstore/docs/PetAPI.md | 268 ++++----- .../petstore/go/go-petstore/docs/StoreAPI.md | 112 ++-- .../petstore/go/go-petstore/docs/UserAPI.md | 216 +++---- .../petstore/go/go-petstore/model_animal.go | 2 +- .../petstore/go/go-petstore/model_big_cat.go | 2 +- .../petstore/go/go-petstore/model_cat.go | 2 +- .../petstore/go/go-petstore/model_category.go | 2 +- .../petstore/go/go-petstore/model_dog.go | 2 +- .../go/go-petstore/model_enum_test_.go | 2 +- .../go/go-petstore/model_format_test_.go | 2 +- .../petstore/go/go-petstore/model_name.go | 2 +- .../petstore/go/go-petstore/model_pet.go | 2 +- .../go-petstore/model_type_holder_default.go | 2 +- .../go-petstore/model_type_holder_example.go | 2 +- .../x-auth-id-alias/go-experimental/README.md | 16 +- .../go-experimental/docs/UsageAPI.md | 104 ++-- .../README.md | 16 +- .../docs/PetAPI.md | 30 +- .../model_pet.go | 2 +- .../client/petstore/go/go-petstore/README.md | 30 +- .../go/go-petstore/docs/AnotherFakeAPI.md | 30 +- .../go/go-petstore/docs/DefaultAPI.md | 26 +- .../petstore/go/go-petstore/docs/FakeAPI.md | 564 +++++++++--------- .../docs/FakeClassnameTags123API.md | 30 +- .../petstore/go/go-petstore/docs/PetAPI.md | 268 ++++----- .../petstore/go/go-petstore/docs/StoreAPI.md | 112 ++-- .../petstore/go/go-petstore/docs/UserAPI.md | 216 +++---- .../petstore/go/go-petstore/model_animal.go | 2 +- .../go/go-petstore/model_apple_req.go | 2 +- .../go/go-petstore/model_banana_req.go | 2 +- .../petstore/go/go-petstore/model_cat.go | 2 +- .../petstore/go/go-petstore/model_category.go | 2 +- .../petstore/go/go-petstore/model_dog.go | 2 +- .../model_duplicated_prop_parent.go | 2 +- .../go/go-petstore/model_enum_test_.go | 2 +- .../go/go-petstore/model_format_test_.go | 2 +- .../petstore/go/go-petstore/model_name.go | 2 +- .../petstore/go/go-petstore/model_pet.go | 2 +- .../petstore/go/go-petstore/model_whale.go | 2 +- .../petstore/go/go-petstore/model_zebra.go | 2 +- .../go-echo-server/handlers/api_pet.go | 55 +- .../go-echo-server/handlers/api_store.go | 31 +- .../go-echo-server/handlers/api_user.go | 55 +- .../go-echo-server/handlers/container.go | 6 +- .../server/petstore/go-echo-server/main.go | 4 +- .../go-echo-server/models/hello-world.go | 4 +- 65 files changed, 1792 insertions(+), 1789 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/api.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/api.mustache index 37c3775eb158..99fd8c67458a 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/api.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/api.mustache @@ -1,9 +1,9 @@ package handlers {{#operations}} import ( - "{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/models" - "github.com/labstack/echo/v4" - "net/http" + "{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/models" + "github.com/labstack/echo/v4" + "net/http" ){{#operation}} // {{nickname}} - {{{summary}}} @@ -11,8 +11,8 @@ import ( // Deprecated {{/isDeprecated}} func (c *Container) {{operationId}}(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } -{{/operation}}{{/operations}} \ No newline at end of file +{{/operation}}{{/operations}} diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/handler-container.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/handler-container.mustache index 330a32f51534..2e4aa441e22c 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/handler-container.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/handler-container.mustache @@ -6,6 +6,6 @@ type Container struct { // NewContainer returns an empty or an initialized container for your handlers. func NewContainer() (Container, error) { - c := Container{} - return c, nil -} \ No newline at end of file + c := Container{} + return c, nil +} diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/hello-world.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/hello-world.mustache index 98b4d20cb613..b939ad04f792 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/hello-world.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/hello-world.mustache @@ -2,5 +2,5 @@ package models // HelloWorld is a sample data structure to make sure each endpoint return something. type HelloWorld struct { - Message string `json:"message"` -} \ No newline at end of file + Message string `json:"message"` +} diff --git a/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache b/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache index 000243ea05d1..879c6bbb0d60 100644 --- a/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache +++ b/modules/openapi-generator/src/main/resources/go-echo-server/main.mustache @@ -9,7 +9,7 @@ import ( func main() { e := echo.New() - //todo: handle the error! + //todo: handle the error! c, _ := handlers.NewContainer() // Middleware @@ -23,4 +23,4 @@ func main() { // Start server e.Logger.Fatal(e.Start(":{{serverPort}}")) -} \ No newline at end of file +} diff --git a/modules/openapi-generator/src/main/resources/go/README.mustache b/modules/openapi-generator/src/main/resources/go/README.mustache index 10ea34849165..6e98ea75f2bb 100644 --- a/modules/openapi-generator/src/main/resources/go/README.mustache +++ b/modules/openapi-generator/src/main/resources/go/README.mustache @@ -21,7 +21,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert {{#hasOAuthMethods}} go get golang.org/x/oauth2 @@ -31,13 +31,13 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: -```golang +```go import {{packageName}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -49,7 +49,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `{{packageName}}.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerIndex, 1) ``` @@ -57,7 +57,7 @@ ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerInde Templated server URL is formatted using default variables from configuration or from context value `{{packageName}}.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), {{packageName}}.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -71,7 +71,7 @@ Each operation can use different server URL defined using `OperationServers` map An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `{{packageName}}.ContextOperationServerIndices` and `{{packageName}}.ContextOperationServerVariables` context maps. -```golang +```go ctx := context.WithValue(context.Background(), {{packageName}}.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -112,7 +112,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), {{packageName}}.ContextAPIKeys, @@ -130,7 +130,7 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` @@ -141,10 +141,10 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go auth := context.WithValue(context.Background(), {{packageName}}.ContextBasicAuth, {{packageName}}.BasicAuth{ - UserName: "username", - Password: "password", + UserName: "username", + Password: "password", }) r, err := client.Service.Operation(auth, args) ``` @@ -155,7 +155,7 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go authConfig := {{packageName}}.HttpSignatureAuth{ KeyId: "my-key-id", PrivateKeyPath: "rsa.pem", @@ -193,14 +193,14 @@ Example Example -```golang +```go auth := context.WithValue(context.Background(), {{packageName}}.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -```golang +```go import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ diff --git a/modules/openapi-generator/src/main/resources/go/api_doc.mustache b/modules/openapi-generator/src/main/resources/go/api_doc.mustache index 623a15be4828..151baa937de5 100644 --- a/modules/openapi-generator/src/main/resources/go/api_doc.mustache +++ b/modules/openapi-generator/src/main/resources/go/api_doc.mustache @@ -26,31 +26,31 @@ Method | HTTP request | Description package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" {{#vendorExtensions.x-go-import}} {{{vendorExtensions.x-go-import}}} {{/vendorExtensions.x-go-import}} - {{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" + {{goImportAlias}} "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}{{#isGoSubmodule}}/{{packageName}}{{/isGoSubmodule}}" ) func main() { - {{#allParams}} - {{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} - {{/allParams}} - - configuration := {{goImportAlias}}.NewConfiguration() - apiClient := {{goImportAlias}}.NewAPIClient(configuration) - {{#returnType}}resp, {{/returnType}}r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - {{#returnType}} - // response from `{{operationId}}`: {{{.}}} - fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp) - {{/returnType}} + {{#allParams}} + {{paramName}} := {{{vendorExtensions.x-go-example}}} // {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} + {{/allParams}} + + configuration := {{goImportAlias}}.NewConfiguration() + apiClient := {{goImportAlias}}.NewAPIClient(configuration) + {{#returnType}}resp, {{/returnType}}r, err := apiClient.{{classname}}.{{operationId}}(context.Background(){{#pathParams}}, {{paramName}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{vendorExtensions.x-export-param-name}}({{paramName}}){{/isPathParam}}{{/allParams}}.Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `{{classname}}.{{operationId}}``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + {{#returnType}} + // response from `{{operationId}}`: {{{.}}} + fmt.Fprintf(os.Stdout, "Response from `{{classname}}.{{operationId}}`: %v\n", resp) + {{/returnType}} } ``` diff --git a/modules/openapi-generator/src/main/resources/go/model_simple.mustache b/modules/openapi-generator/src/main/resources/go/model_simple.mustache index d5b2580a6d7f..12e69de0f442 100644 --- a/modules/openapi-generator/src/main/resources/go/model_simple.mustache +++ b/modules/openapi-generator/src/main/resources/go/model_simple.mustache @@ -348,7 +348,7 @@ func (o *{{{classname}}}) UnmarshalJSON(bytes []byte) (err error) { {{/hasRequired}} {{/isAdditionalPropertiesTrue}} {{#hasRequired}} - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/echo_api/go/README.md b/samples/client/echo_api/go/README.md index 457d2cae3672..08c67610c6eb 100644 --- a/samples/client/echo_api/go/README.md +++ b/samples/client/echo_api/go/README.md @@ -13,20 +13,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert go get golang.org/x/net/context ``` Put the package under your project folder and add the following in import: -```golang +```go import openapi "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -38,7 +38,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `openapi.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) ``` @@ -46,7 +46,7 @@ ctx := context.WithValue(context.Background(), openapi.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `openapi.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), openapi.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -60,7 +60,7 @@ Each operation can use different server URL defined using `OperationServers` map An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `openapi.ContextOperationServerIndices` and `openapi.ContextOperationServerVariables` context maps. -```golang +```go ctx := context.WithValue(context.Background(), openapi.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -126,10 +126,10 @@ Authentication schemes defined for the API: Example -```golang +```go auth := context.WithValue(context.Background(), openapi.ContextBasicAuth, openapi.BasicAuth{ - UserName: "username", - Password: "password", + UserName: "username", + Password: "password", }) r, err := client.Service.Operation(auth, args) ``` @@ -140,7 +140,7 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go auth := context.WithValue(context.Background(), openapi.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` diff --git a/samples/client/echo_api/go/docs/AuthAPI.md b/samples/client/echo_api/go/docs/AuthAPI.md index 996e58a1bf56..046104c5053c 100644 --- a/samples/client/echo_api/go/docs/AuthAPI.md +++ b/samples/client/echo_api/go/docs/AuthAPI.md @@ -23,23 +23,23 @@ To test HTTP basic authentication package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AuthAPI.TestAuthHttpBasic(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBasic``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestAuthHttpBasic`: string - fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBasic`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthAPI.TestAuthHttpBasic(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBasic``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestAuthHttpBasic`: string + fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBasic`: %v\n", resp) } ``` @@ -84,23 +84,23 @@ To test HTTP bearer authentication package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AuthAPI.TestAuthHttpBearer(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBearer``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestAuthHttpBearer`: string - fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBearer`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AuthAPI.TestAuthHttpBearer(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AuthAPI.TestAuthHttpBearer``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestAuthHttpBearer`: string + fmt.Fprintf(os.Stdout, "Response from `AuthAPI.TestAuthHttpBearer`: %v\n", resp) } ``` diff --git a/samples/client/echo_api/go/docs/BodyAPI.md b/samples/client/echo_api/go/docs/BodyAPI.md index 111542e9714b..d54fb2278911 100644 --- a/samples/client/echo_api/go/docs/BodyAPI.md +++ b/samples/client/echo_api/go/docs/BodyAPI.md @@ -29,23 +29,23 @@ Test binary (gif) response body package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestBinaryGif(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBinaryGif``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestBinaryGif`: *os.File - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBinaryGif`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestBinaryGif(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBinaryGif``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestBinaryGif`: *os.File + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBinaryGif`: %v\n", resp) } ``` @@ -90,24 +90,24 @@ Test body parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := os.NewFile(1234, "some_file") // *os.File | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestBodyApplicationOctetstreamBinary(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyApplicationOctetstreamBinary``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestBodyApplicationOctetstreamBinary`: string - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyApplicationOctetstreamBinary`: %v\n", resp) + body := os.NewFile(1234, "some_file") // *os.File | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestBodyApplicationOctetstreamBinary(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyApplicationOctetstreamBinary``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestBodyApplicationOctetstreamBinary`: string + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyApplicationOctetstreamBinary`: %v\n", resp) } ``` @@ -156,24 +156,24 @@ Test array of binary in multipart mime package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - files := []*os.File{"TODO"} // []*os.File | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestBodyMultipartFormdataArrayOfBinary(context.Background()).Files(files).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyMultipartFormdataArrayOfBinary``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestBodyMultipartFormdataArrayOfBinary`: string - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyMultipartFormdataArrayOfBinary`: %v\n", resp) + files := []*os.File{"TODO"} // []*os.File | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestBodyMultipartFormdataArrayOfBinary(context.Background()).Files(files).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestBodyMultipartFormdataArrayOfBinary``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestBodyMultipartFormdataArrayOfBinary`: string + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestBodyMultipartFormdataArrayOfBinary`: %v\n", resp) } ``` @@ -222,24 +222,24 @@ Test body parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestEchoBodyAllOfPet(context.Background()).Pet(pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyAllOfPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestEchoBodyAllOfPet`: Pet - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyAllOfPet`: %v\n", resp) + pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestEchoBodyAllOfPet(context.Background()).Pet(pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyAllOfPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestEchoBodyAllOfPet`: Pet + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyAllOfPet`: %v\n", resp) } ``` @@ -288,24 +288,24 @@ Test free form object package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := map[string]interface{}{ ... } // map[string]interface{} | Free form object (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestEchoBodyFreeFormObjectResponseString(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyFreeFormObjectResponseString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestEchoBodyFreeFormObjectResponseString`: string - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyFreeFormObjectResponseString`: %v\n", resp) + body := map[string]interface{}{ ... } // map[string]interface{} | Free form object (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestEchoBodyFreeFormObjectResponseString(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyFreeFormObjectResponseString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestEchoBodyFreeFormObjectResponseString`: string + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyFreeFormObjectResponseString`: %v\n", resp) } ``` @@ -354,24 +354,24 @@ Test body parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestEchoBodyPet(context.Background()).Pet(pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestEchoBodyPet`: Pet - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPet`: %v\n", resp) + pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestEchoBodyPet(context.Background()).Pet(pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestEchoBodyPet`: Pet + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPet`: %v\n", resp) } ``` @@ -420,24 +420,24 @@ Test empty response body package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestEchoBodyPetResponseString(context.Background()).Pet(pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPetResponseString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestEchoBodyPetResponseString`: string - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPetResponseString`: %v\n", resp) + pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestEchoBodyPetResponseString(context.Background()).Pet(pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyPetResponseString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestEchoBodyPetResponseString`: string + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyPetResponseString`: %v\n", resp) } ``` @@ -486,24 +486,24 @@ Test empty json (request body) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - tag := *openapiclient.NewTag() // Tag | Tag object (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.BodyAPI.TestEchoBodyTagResponseString(context.Background()).Tag(tag).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyTagResponseString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestEchoBodyTagResponseString`: string - fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyTagResponseString`: %v\n", resp) + tag := *openapiclient.NewTag() // Tag | Tag object (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.BodyAPI.TestEchoBodyTagResponseString(context.Background()).Tag(tag).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `BodyAPI.TestEchoBodyTagResponseString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestEchoBodyTagResponseString`: string + fmt.Fprintf(os.Stdout, "Response from `BodyAPI.TestEchoBodyTagResponseString`: %v\n", resp) } ``` diff --git a/samples/client/echo_api/go/docs/FormAPI.md b/samples/client/echo_api/go/docs/FormAPI.md index 7f3e725dc4a8..56d7d9921db0 100644 --- a/samples/client/echo_api/go/docs/FormAPI.md +++ b/samples/client/echo_api/go/docs/FormAPI.md @@ -23,26 +23,26 @@ Test form parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - integerForm := int32(56) // int32 | (optional) - booleanForm := true // bool | (optional) - stringForm := "stringForm_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FormAPI.TestFormIntegerBooleanString(context.Background()).IntegerForm(integerForm).BooleanForm(booleanForm).StringForm(stringForm).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormIntegerBooleanString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestFormIntegerBooleanString`: string - fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormIntegerBooleanString`: %v\n", resp) + integerForm := int32(56) // int32 | (optional) + booleanForm := true // bool | (optional) + stringForm := "stringForm_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FormAPI.TestFormIntegerBooleanString(context.Background()).IntegerForm(integerForm).BooleanForm(booleanForm).StringForm(stringForm).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormIntegerBooleanString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestFormIntegerBooleanString`: string + fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormIntegerBooleanString`: %v\n", resp) } ``` @@ -93,29 +93,29 @@ Test form parameter(s) for oneOf schema package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - form1 := "form1_example" // string | (optional) - form2 := int32(56) // int32 | (optional) - form3 := "form3_example" // string | (optional) - form4 := true // bool | (optional) - id := int64(789) // int64 | (optional) - name := "name_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FormAPI.TestFormOneof(context.Background()).Form1(form1).Form2(form2).Form3(form3).Form4(form4).Id(id).Name(name).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormOneof``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestFormOneof`: string - fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormOneof`: %v\n", resp) + form1 := "form1_example" // string | (optional) + form2 := int32(56) // int32 | (optional) + form3 := "form3_example" // string | (optional) + form4 := true // bool | (optional) + id := int64(789) // int64 | (optional) + name := "name_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FormAPI.TestFormOneof(context.Background()).Form1(form1).Form2(form2).Form3(form3).Form4(form4).Id(id).Name(name).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FormAPI.TestFormOneof``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestFormOneof`: string + fmt.Fprintf(os.Stdout, "Response from `FormAPI.TestFormOneof`: %v\n", resp) } ``` diff --git a/samples/client/echo_api/go/docs/HeaderAPI.md b/samples/client/echo_api/go/docs/HeaderAPI.md index 18c6b5bef617..859a1f9dd40f 100644 --- a/samples/client/echo_api/go/docs/HeaderAPI.md +++ b/samples/client/echo_api/go/docs/HeaderAPI.md @@ -22,28 +22,28 @@ Test header parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - integerHeader := int32(56) // int32 | (optional) - booleanHeader := true // bool | (optional) - stringHeader := "stringHeader_example" // string | (optional) - enumNonrefStringHeader := "enumNonrefStringHeader_example" // string | (optional) - enumRefStringHeader := openapiclient.StringEnumRef("success") // StringEnumRef | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.HeaderAPI.TestHeaderIntegerBooleanStringEnums(context.Background()).IntegerHeader(integerHeader).BooleanHeader(booleanHeader).StringHeader(stringHeader).EnumNonrefStringHeader(enumNonrefStringHeader).EnumRefStringHeader(enumRefStringHeader).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `HeaderAPI.TestHeaderIntegerBooleanStringEnums``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestHeaderIntegerBooleanStringEnums`: string - fmt.Fprintf(os.Stdout, "Response from `HeaderAPI.TestHeaderIntegerBooleanStringEnums`: %v\n", resp) + integerHeader := int32(56) // int32 | (optional) + booleanHeader := true // bool | (optional) + stringHeader := "stringHeader_example" // string | (optional) + enumNonrefStringHeader := "enumNonrefStringHeader_example" // string | (optional) + enumRefStringHeader := openapiclient.StringEnumRef("success") // StringEnumRef | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.HeaderAPI.TestHeaderIntegerBooleanStringEnums(context.Background()).IntegerHeader(integerHeader).BooleanHeader(booleanHeader).StringHeader(stringHeader).EnumNonrefStringHeader(enumNonrefStringHeader).EnumRefStringHeader(enumRefStringHeader).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `HeaderAPI.TestHeaderIntegerBooleanStringEnums``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestHeaderIntegerBooleanStringEnums`: string + fmt.Fprintf(os.Stdout, "Response from `HeaderAPI.TestHeaderIntegerBooleanStringEnums`: %v\n", resp) } ``` diff --git a/samples/client/echo_api/go/docs/PathAPI.md b/samples/client/echo_api/go/docs/PathAPI.md index 1b976a457e06..2ae33bb6e96a 100644 --- a/samples/client/echo_api/go/docs/PathAPI.md +++ b/samples/client/echo_api/go/docs/PathAPI.md @@ -22,27 +22,27 @@ Test path parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pathString := "pathString_example" // string | - pathInteger := int32(56) // int32 | - enumNonrefStringPath := "enumNonrefStringPath_example" // string | - enumRefStringPath := openapiclient.StringEnumRef("success") // StringEnumRef | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(context.Background(), pathString, pathInteger, enumNonrefStringPath, enumRefStringPath).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: string - fmt.Fprintf(os.Stdout, "Response from `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: %v\n", resp) + pathString := "pathString_example" // string | + pathInteger := int32(56) // int32 | + enumNonrefStringPath := "enumNonrefStringPath_example" // string | + enumRefStringPath := openapiclient.StringEnumRef("success") // StringEnumRef | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath(context.Background(), pathString, pathInteger, enumNonrefStringPath, enumRefStringPath).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: string + fmt.Fprintf(os.Stdout, "Response from `PathAPI.TestsPathStringPathStringIntegerPathIntegerEnumNonrefStringPathEnumRefStringPath`: %v\n", resp) } ``` diff --git a/samples/client/echo_api/go/docs/QueryAPI.md b/samples/client/echo_api/go/docs/QueryAPI.md index 815c9f9df9da..766c0c9ba8e8 100644 --- a/samples/client/echo_api/go/docs/QueryAPI.md +++ b/samples/client/echo_api/go/docs/QueryAPI.md @@ -29,25 +29,25 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - enumNonrefStringQuery := "enumNonrefStringQuery_example" // string | (optional) - enumRefStringQuery := openapiclient.StringEnumRef("success") // StringEnumRef | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestEnumRefString(context.Background()).EnumNonrefStringQuery(enumNonrefStringQuery).EnumRefStringQuery(enumRefStringQuery).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestEnumRefString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestEnumRefString`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestEnumRefString`: %v\n", resp) + enumNonrefStringQuery := "enumNonrefStringQuery_example" // string | (optional) + enumRefStringQuery := openapiclient.StringEnumRef("success") // StringEnumRef | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestEnumRefString(context.Background()).EnumNonrefStringQuery(enumNonrefStringQuery).EnumRefStringQuery(enumRefStringQuery).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestEnumRefString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestEnumRefString`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestEnumRefString`: %v\n", resp) } ``` @@ -97,27 +97,27 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - datetimeQuery := time.Now() // time.Time | (optional) - dateQuery := time.Now() // string | (optional) - stringQuery := "stringQuery_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryDatetimeDateString(context.Background()).DatetimeQuery(datetimeQuery).DateQuery(dateQuery).StringQuery(stringQuery).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryDatetimeDateString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryDatetimeDateString`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryDatetimeDateString`: %v\n", resp) + datetimeQuery := time.Now() // time.Time | (optional) + dateQuery := time.Now() // string | (optional) + stringQuery := "stringQuery_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryDatetimeDateString(context.Background()).DatetimeQuery(datetimeQuery).DateQuery(dateQuery).StringQuery(stringQuery).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryDatetimeDateString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryDatetimeDateString`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryDatetimeDateString`: %v\n", resp) } ``` @@ -168,26 +168,26 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - integerQuery := int32(56) // int32 | (optional) - booleanQuery := true // bool | (optional) - stringQuery := "stringQuery_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryIntegerBooleanString(context.Background()).IntegerQuery(integerQuery).BooleanQuery(booleanQuery).StringQuery(stringQuery).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryIntegerBooleanString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryIntegerBooleanString`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryIntegerBooleanString`: %v\n", resp) + integerQuery := int32(56) // int32 | (optional) + booleanQuery := true // bool | (optional) + stringQuery := "stringQuery_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryIntegerBooleanString(context.Background()).IntegerQuery(integerQuery).BooleanQuery(booleanQuery).StringQuery(stringQuery).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryIntegerBooleanString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryIntegerBooleanString`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryIntegerBooleanString`: %v\n", resp) } ``` @@ -238,24 +238,24 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryStyleDeepObjectExplodeTrueObject`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject`: %v\n", resp) + queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryStyleDeepObjectExplodeTrueObject`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObject`: %v\n", resp) } ``` @@ -304,24 +304,24 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - queryObject := *openapiclient.NewTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() // TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: %v\n", resp) + queryObject := *openapiclient.NewTestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter() // TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleDeepObjectExplodeTrueObjectAllOf`: %v\n", resp) } ``` @@ -370,24 +370,24 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - queryObject := *openapiclient.NewTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueArrayString(context.Background()).QueryObject(queryObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueArrayString``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryStyleFormExplodeTrueArrayString`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueArrayString`: %v\n", resp) + queryObject := *openapiclient.NewTestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter() // TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueArrayString(context.Background()).QueryObject(queryObject).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueArrayString``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryStyleFormExplodeTrueArrayString`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueArrayString`: %v\n", resp) } ``` @@ -436,24 +436,24 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObject``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryStyleFormExplodeTrueObject`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObject`: %v\n", resp) + queryObject := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObject(context.Background()).QueryObject(queryObject).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryStyleFormExplodeTrueObject`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObject`: %v\n", resp) } ``` @@ -502,24 +502,24 @@ Test query parameter(s) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - queryObject := *openapiclient.NewDataQuery() // DataQuery | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestQueryStyleFormExplodeTrueObjectAllOf`: string - fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf`: %v\n", resp) + queryObject := *openapiclient.NewDataQuery() // DataQuery | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf(context.Background()).QueryObject(queryObject).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestQueryStyleFormExplodeTrueObjectAllOf`: string + fmt.Fprintf(os.Stdout, "Response from `QueryAPI.TestQueryStyleFormExplodeTrueObjectAllOf`: %v\n", resp) } ``` diff --git a/samples/client/echo_api/go/model_pet.go b/samples/client/echo_api/go/model_pet.go index ca46658c236d..22d9ffe02075 100644 --- a/samples/client/echo_api/go/model_pet.go +++ b/samples/client/echo_api/go/model_pet.go @@ -255,7 +255,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) { } func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index 2d3e2e0e4c4f..162f25584d49 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -13,7 +13,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context @@ -21,13 +21,13 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: -```golang +```go import petstore "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -39,7 +39,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) ``` @@ -47,7 +47,7 @@ ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -61,7 +61,7 @@ Each operation can use different server URL defined using `OperationServers` map An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -182,14 +182,14 @@ Authentication schemes defined for the API: Example -```golang +```go auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -```golang +```go import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ @@ -209,7 +209,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), petstore.ContextAPIKeys, @@ -230,7 +230,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), petstore.ContextAPIKeys, @@ -247,10 +247,10 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{ - UserName: "username", - Password: "password", + UserName: "username", + Password: "password", }) r, err := client.Service.Operation(auth, args) ``` diff --git a/samples/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md b/samples/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md index fe1788992d25..87709d905917 100644 --- a/samples/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md +++ b/samples/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md @@ -22,25 +22,25 @@ To test special tags package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - uuidTest := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | to test uuid example value - body := *openapiclient.NewClient() // Client | client model - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).UuidTest(uuidTest).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `Call123TestSpecialTags`: Client - fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp) + uuidTest := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | to test uuid example value + body := *openapiclient.NewClient() // Client | client model + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).UuidTest(uuidTest).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Call123TestSpecialTags`: Client + fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp) } ``` diff --git a/samples/client/petstore/go/go-petstore/docs/FakeAPI.md b/samples/client/petstore/go/go-petstore/docs/FakeAPI.md index 59c3df6eec15..34a895493c67 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeAPI.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeAPI.md @@ -35,22 +35,22 @@ creates an XmlItem package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - xmlItem := *openapiclient.NewXmlItem() // XmlItem | XmlItem Body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.CreateXmlItem``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + xmlItem := *openapiclient.NewXmlItem() // XmlItem | XmlItem Body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.CreateXmlItem(context.Background()).XmlItem(xmlItem).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.CreateXmlItem``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -99,24 +99,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := true // bool | Input boolean as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterBooleanSerialize`: bool - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp) + body := true // bool | Input boolean as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterBooleanSerialize`: bool + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp) } ``` @@ -165,24 +165,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterCompositeSerialize`: OuterComposite - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp) + body := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterCompositeSerialize`: OuterComposite + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp) } ``` @@ -231,24 +231,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := float32(8.14) // float32 | Input number as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterNumberSerialize`: float32 - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp) + body := float32(8.14) // float32 | Input number as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterNumberSerialize`: float32 + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp) } ``` @@ -297,24 +297,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := "body_example" // string | Input string as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterStringSerialize`: string - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp) + body := "body_example" // string | Input string as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterStringSerialize`: string + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp) } ``` @@ -363,22 +363,22 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + body := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -425,23 +425,23 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - query := "query_example" // string | - body := *openapiclient.NewUser() // User | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + query := "query_example" // string | + body := *openapiclient.NewUser() // User | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -491,24 +491,24 @@ To test \"client\" model package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewClient() // Client | client model - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClientModel`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp) + body := *openapiclient.NewClient() // Client | client model + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClientModel`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp) } ``` @@ -557,36 +557,36 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイ package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - number := float32(8.14) // float32 | None - double := float64(1.2) // float64 | None - patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None - byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None - integer := int32(56) // int32 | None (optional) - int32_ := int32(56) // int32 | None (optional) - int64_ := int64(789) // int64 | None (optional) - float := float32(3.4) // float32 | None (optional) - string_ := "string__example" // string | None (optional) - binary := os.NewFile(1234, "some_file") // *os.File | None (optional) - date := time.Now() // string | None (optional) - dateTime := time.Now() // time.Time | None (optional) - password := "password_example" // string | None (optional) - callback := "callback_example" // string | None (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + number := float32(8.14) // float32 | None + double := float64(1.2) // float64 | None + patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None + byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None + integer := int32(56) // int32 | None (optional) + int32_ := int32(56) // int32 | None (optional) + int64_ := int64(789) // int64 | None (optional) + float := float32(3.4) // float32 | None (optional) + string_ := "string__example" // string | None (optional) + binary := os.NewFile(1234, "some_file") // *os.File | None (optional) + date := time.Now() // string | None (optional) + dateTime := time.Now() // time.Time | None (optional) + password := "password_example" // string | None (optional) + callback := "callback_example" // string | None (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -648,29 +648,29 @@ To test enum parameters package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) - enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") - enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) - enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") - enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional) - enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional) - enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") - enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) + enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") + enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) + enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") + enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional) + enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional) + enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") + enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -726,27 +726,27 @@ Fake endpoint to test group parameters (optional) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - requiredStringGroup := int32(56) // int32 | Required String in group parameters - requiredBooleanGroup := true // bool | Required Boolean in group parameters - requiredInt64Group := int64(789) // int64 | Required Integer in group parameters - stringGroup := int32(56) // int32 | String in group parameters (optional) - booleanGroup := true // bool | Boolean in group parameters (optional) - int64Group := int64(789) // int64 | Integer in group parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + requiredStringGroup := int32(56) // int32 | Required String in group parameters + requiredBooleanGroup := true // bool | Required Boolean in group parameters + requiredInt64Group := int64(789) // int64 | Required Integer in group parameters + stringGroup := int32(56) // int32 | String in group parameters (optional) + booleanGroup := true // bool | Boolean in group parameters (optional) + int64Group := int64(789) // int64 | Integer in group parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -798,22 +798,22 @@ test inline additionalProperties package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - param := map[string]string{"key": "Inner_example"} // map[string]string | request body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).Param(param).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + param := map[string]string{"key": "Inner_example"} // map[string]string | request body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).Param(param).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -860,23 +860,23 @@ test json serialization of form data package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - param := "param_example" // string | field1 - param2 := "param2_example" // string | field2 - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + param := "param_example" // string | field1 + param2 := "param2_example" // string | field2 + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -926,26 +926,26 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pipe := []string{"Inner_example"} // []string | - ioutil := []string{"Inner_example"} // []string | - http := []string{"Inner_example"} // []string | - url := []string{"Inner_example"} // []string | - context := []string{"Inner_example"} // []string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + pipe := []string{"Inner_example"} // []string | + ioutil := []string{"Inner_example"} // []string | + http := []string{"Inner_example"} // []string | + url := []string{"Inner_example"} // []string | + context := []string{"Inner_example"} // []string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` diff --git a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md index cf15937a87f1..340a5751ba33 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md @@ -22,24 +22,24 @@ To test class name in snake case package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewClient() // Client | client model - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClassname`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp) + body := *openapiclient.NewClient() // Client | client model + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClassname`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp) } ``` diff --git a/samples/client/petstore/go/go-petstore/docs/PetAPI.md b/samples/client/petstore/go/go-petstore/docs/PetAPI.md index a454f486cf40..adaec60d0556 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetAPI.md +++ b/samples/client/petstore/go/go-petstore/docs/PetAPI.md @@ -28,22 +28,22 @@ Add a new pet to the store package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.AddPet(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.AddPet(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -90,23 +90,23 @@ Deletes a pet package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | Pet id to delete - apiKey := "apiKey_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + petId := int64(789) // int64 | Pet id to delete + apiKey := "apiKey_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -160,24 +160,24 @@ Finds Pets by status package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - status := []string{"Status_example"} // []string | Status values that need to be considered for filter - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByStatus`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp) + status := []string{"Status_example"} // []string | Status values that need to be considered for filter + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByStatus`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp) } ``` @@ -226,24 +226,24 @@ Finds Pets by tags package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - tags := []string{"Inner_example"} // []string | Tags to filter by - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByTags`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp) + tags := []string{"Inner_example"} // []string | Tags to filter by + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByTags`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp) } ``` @@ -292,24 +292,24 @@ Find pet by ID package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet to return - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPetById`: Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp) + petId := int64(789) // int64 | ID of pet to return + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPetById`: Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp) } ``` @@ -360,22 +360,22 @@ Update an existing pet package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.UpdatePet(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + body := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.UpdatePet(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -422,24 +422,24 @@ Updates a pet in the store with form data package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet that needs to be updated - name := "name_example" // string | Updated name of the pet (optional) - status := "status_example" // string | Updated status of the pet (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + petId := int64(789) // int64 | ID of pet that needs to be updated + name := "name_example" // string | Updated name of the pet (optional) + status := "status_example" // string | Updated status of the pet (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -492,26 +492,26 @@ uploads an image package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet to update - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp) + petId := int64(789) // int64 | ID of pet to update + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp) } ``` @@ -564,26 +564,26 @@ uploads an image (required) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet to update - requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFileWithRequiredFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp) + petId := int64(789) // int64 | ID of pet to update + requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFileWithRequiredFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp) } ``` diff --git a/samples/client/petstore/go/go-petstore/docs/StoreAPI.md b/samples/client/petstore/go/go-petstore/docs/StoreAPI.md index e27106923154..e78d6a9db373 100644 --- a/samples/client/petstore/go/go-petstore/docs/StoreAPI.md +++ b/samples/client/petstore/go/go-petstore/docs/StoreAPI.md @@ -25,22 +25,22 @@ Delete purchase order by ID package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - orderId := "orderId_example" // string | ID of the order that needs to be deleted - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + orderId := "orderId_example" // string | ID of the order that needs to be deleted + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -93,23 +93,23 @@ Returns pet inventories by status package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetInventory`: map[string]int32 - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInventory`: map[string]int32 + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp) } ``` @@ -154,24 +154,24 @@ Find purchase order by ID package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - orderId := int64(789) // int64 | ID of pet that needs to be fetched - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOrderById`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp) + orderId := int64(789) // int64 | ID of pet that needs to be fetched + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOrderById`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp) } ``` @@ -222,24 +222,24 @@ Place an order for a pet package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewOrder() // Order | order placed for purchasing the pet - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PlaceOrder`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp) + body := *openapiclient.NewOrder() // Order | order placed for purchasing the pet + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PlaceOrder`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp) } ``` diff --git a/samples/client/petstore/go/go-petstore/docs/UserAPI.md b/samples/client/petstore/go/go-petstore/docs/UserAPI.md index af61745c62f2..480ea53a65a3 100644 --- a/samples/client/petstore/go/go-petstore/docs/UserAPI.md +++ b/samples/client/petstore/go/go-petstore/docs/UserAPI.md @@ -29,22 +29,22 @@ Create user package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := *openapiclient.NewUser() // User | Created user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.CreateUser(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + body := *openapiclient.NewUser() // User | Created user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.CreateUser(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -91,22 +91,22 @@ Creates list of users with given input array package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -153,22 +153,22 @@ Creates list of users with given input array package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + body := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -217,22 +217,22 @@ Delete user package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | The name that needs to be deleted - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + username := "username_example" // string | The name that needs to be deleted + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -283,24 +283,24 @@ Get user by user name package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUserByName`: User - fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp) + username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUserByName`: User + fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp) } ``` @@ -351,25 +351,25 @@ Logs user into the system package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | The user name for login - password := "password_example" // string | The password for login in clear text - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `LoginUser`: string - fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp) + username := "username_example" // string | The user name for login + password := "password_example" // string | The password for login in clear text + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `LoginUser`: string + fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp) } ``` @@ -417,21 +417,21 @@ Logs out current logged in user session package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -476,23 +476,23 @@ Updated user package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | name that need to be deleted - body := *openapiclient.NewUser() // User | Updated user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + username := "username_example" // string | name that need to be deleted + body := *openapiclient.NewUser() // User | Updated user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` diff --git a/samples/client/petstore/go/go-petstore/model_animal.go b/samples/client/petstore/go/go-petstore/model_animal.go index bb96f81e892b..b3bd9e82def0 100644 --- a/samples/client/petstore/go/go-petstore/model_animal.go +++ b/samples/client/petstore/go/go-petstore/model_animal.go @@ -122,7 +122,7 @@ func (o Animal) ToMap() (map[string]interface{}, error) { } func (o *Animal) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_big_cat.go b/samples/client/petstore/go/go-petstore/model_big_cat.go index 4193ee0679c7..4ebdad84764b 100644 --- a/samples/client/petstore/go/go-petstore/model_big_cat.go +++ b/samples/client/petstore/go/go-petstore/model_big_cat.go @@ -103,7 +103,7 @@ func (o BigCat) ToMap() (map[string]interface{}, error) { } func (o *BigCat) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_cat.go b/samples/client/petstore/go/go-petstore/model_cat.go index 1c3b87e12af9..8b1741a9ef4c 100644 --- a/samples/client/petstore/go/go-petstore/model_cat.go +++ b/samples/client/petstore/go/go-petstore/model_cat.go @@ -103,7 +103,7 @@ func (o Cat) ToMap() (map[string]interface{}, error) { } func (o *Cat) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_category.go b/samples/client/petstore/go/go-petstore/model_category.go index b756bcf401c6..99a8ac1f94d6 100644 --- a/samples/client/petstore/go/go-petstore/model_category.go +++ b/samples/client/petstore/go/go-petstore/model_category.go @@ -120,7 +120,7 @@ func (o Category) ToMap() (map[string]interface{}, error) { } func (o *Category) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_dog.go b/samples/client/petstore/go/go-petstore/model_dog.go index 3c6a8dbd9e1f..7d732f40f3c5 100644 --- a/samples/client/petstore/go/go-petstore/model_dog.go +++ b/samples/client/petstore/go/go-petstore/model_dog.go @@ -103,7 +103,7 @@ func (o Dog) ToMap() (map[string]interface{}, error) { } func (o *Dog) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_enum_test_.go b/samples/client/petstore/go/go-petstore/model_enum_test_.go index 64db2237811e..9e280d0d22ca 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/client/petstore/go/go-petstore/model_enum_test_.go @@ -226,7 +226,7 @@ func (o EnumTest) ToMap() (map[string]interface{}, error) { } func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_format_test_.go b/samples/client/petstore/go/go-petstore/model_format_test_.go index 0feac05dd05f..7a5bfc95343a 100644 --- a/samples/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/client/petstore/go/go-petstore/model_format_test_.go @@ -525,7 +525,7 @@ func (o FormatTest) ToMap() (map[string]interface{}, error) { } func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_name.go b/samples/client/petstore/go/go-petstore/model_name.go index 24741e9b9386..0ecb878c6c03 100644 --- a/samples/client/petstore/go/go-petstore/model_name.go +++ b/samples/client/petstore/go/go-petstore/model_name.go @@ -190,7 +190,7 @@ func (o Name) ToMap() (map[string]interface{}, error) { } func (o *Name) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_pet.go b/samples/client/petstore/go/go-petstore/model_pet.go index d22f60a621a0..143db2578aa7 100644 --- a/samples/client/petstore/go/go-petstore/model_pet.go +++ b/samples/client/petstore/go/go-petstore/model_pet.go @@ -254,7 +254,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) { } func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_default.go b/samples/client/petstore/go/go-petstore/model_type_holder_default.go index ac8e0889c046..fd95804b04e9 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_default.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_default.go @@ -194,7 +194,7 @@ func (o TypeHolderDefault) ToMap() (map[string]interface{}, error) { } func (o *TypeHolderDefault) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/client/petstore/go/go-petstore/model_type_holder_example.go b/samples/client/petstore/go/go-petstore/model_type_holder_example.go index 7ad8753a7852..544164b9acef 100644 --- a/samples/client/petstore/go/go-petstore/model_type_holder_example.go +++ b/samples/client/petstore/go/go-petstore/model_type_holder_example.go @@ -217,7 +217,7 @@ func (o TypeHolderExample) ToMap() (map[string]interface{}, error) { } func (o *TypeHolderExample) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md index eda0b06b0f51..6d9b0b811670 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/README.md @@ -13,20 +13,20 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert go get golang.org/x/net/context ``` Put the package under your project folder and add the following in import: -```golang +```go import x_auth_id_alias "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -38,7 +38,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `x_auth_id_alias.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerIndex, 1) ``` @@ -46,7 +46,7 @@ ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerInde Templated server URL is formatted using default variables from configuration or from context value `x_auth_id_alias.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -60,7 +60,7 @@ Each operation can use different server URL defined using `OperationServers` map An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `x_auth_id_alias.ContextOperationServerIndices` and `x_auth_id_alias.ContextOperationServerVariables` context maps. -```golang +```go ctx := context.WithValue(context.Background(), x_auth_id_alias.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -101,7 +101,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), x_auth_id_alias.ContextAPIKeys, @@ -122,7 +122,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), x_auth_id_alias.ContextAPIKeys, diff --git a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageAPI.md b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageAPI.md index 3d924a659c6c..c5046e375740 100644 --- a/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageAPI.md +++ b/samples/openapi3/client/extensions/x-auth-id-alias/go-experimental/docs/UsageAPI.md @@ -25,23 +25,23 @@ Use any API key package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.AnyKey(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.AnyKey``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AnyKey`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `UsageAPI.AnyKey`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageAPI.AnyKey(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.AnyKey``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AnyKey`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `UsageAPI.AnyKey`: %v\n", resp) } ``` @@ -86,23 +86,23 @@ Use both API keys package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.BothKeys(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.BothKeys``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `BothKeys`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `UsageAPI.BothKeys`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageAPI.BothKeys(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.BothKeys``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `BothKeys`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `UsageAPI.BothKeys`: %v\n", resp) } ``` @@ -147,23 +147,23 @@ Use API key in header package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.KeyInHeader(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInHeader``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyInHeader`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInHeader`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageAPI.KeyInHeader(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInHeader``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyInHeader`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInHeader`: %v\n", resp) } ``` @@ -208,23 +208,23 @@ Use API key in query package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UsageAPI.KeyInQuery(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInQuery``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `KeyInQuery`: map[string]interface{} - fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInQuery`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UsageAPI.KeyInQuery(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UsageAPI.KeyInQuery``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `KeyInQuery`: map[string]interface{} + fmt.Fprintf(os.Stdout, "Response from `UsageAPI.KeyInQuery`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/README.md b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/README.md index 1177f83d475f..d53f59d0635c 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/README.md +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/README.md @@ -13,7 +13,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context @@ -21,13 +21,13 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: -```golang +```go import petstore "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -39,7 +39,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) ``` @@ -47,7 +47,7 @@ ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -61,7 +61,7 @@ Each operation can use different server URL defined using `OperationServers` map An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -104,14 +104,14 @@ Authentication schemes defined for the API: Example -```golang +```go auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -```golang +```go import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/docs/PetAPI.md b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/docs/PetAPI.md index e2613a408167..0881d5fe198f 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/docs/PetAPI.md +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/docs/PetAPI.md @@ -22,24 +22,24 @@ Add a new pet to the store package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `AddPet`: Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.AddPet`: %v\n", resp) + pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `AddPet`: Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.AddPet`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_pet.go b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_pet.go index 28577087d8b1..863d8eeb1d4b 100644 --- a/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_pet.go +++ b/samples/openapi3/client/petstore/go-petstore-generateMarshalJSON-false/model_pet.go @@ -256,7 +256,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) { } func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/README.md b/samples/openapi3/client/petstore/go/go-petstore/README.md index 2906b11b6234..d7b549125d91 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/README.md +++ b/samples/openapi3/client/petstore/go/go-petstore/README.md @@ -13,7 +13,7 @@ This API client was generated by the [OpenAPI Generator](https://openapi-generat Install the following dependencies: -```shell +```sh go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context @@ -21,13 +21,13 @@ go get golang.org/x/net/context Put the package under your project folder and add the following in import: -```golang +```go import petstore "github.com/GIT_USER_ID/GIT_REPO_ID" ``` To use a proxy, set the environment variable `HTTP_PROXY`: -```golang +```go os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port") ``` @@ -39,7 +39,7 @@ Default configuration comes with `Servers` field that contains server objects as For using other server than the one defined on index 0 set context value `petstore.ContextServerIndex` of type `int`. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) ``` @@ -47,7 +47,7 @@ ctx := context.WithValue(context.Background(), petstore.ContextServerIndex, 1) Templated server URL is formatted using default variables from configuration or from context value `petstore.ContextServerVariables` of type `map[string]string`. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextServerVariables, map[string]string{ "basePath": "v2", }) @@ -61,7 +61,7 @@ Each operation can use different server URL defined using `OperationServers` map An operation is uniquely identified by `"{classname}Service.{nickname}"` string. Similar rules for overriding default operation server index and variables applies by using `petstore.ContextOperationServerIndices` and `petstore.ContextOperationServerVariables` context maps. -```golang +```go ctx := context.WithValue(context.Background(), petstore.ContextOperationServerIndices, map[string]int{ "{classname}Service.{nickname}": 2, }) @@ -205,14 +205,14 @@ Authentication schemes defined for the API: Example -```golang +```go auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "ACCESSTOKENSTRING") r, err := client.Service.Operation(auth, args) ``` Or via OAuth2 module to automatically refresh tokens and perform user authentication. -```golang +```go import "golang.org/x/oauth2" /* Perform OAuth2 round trip request and obtain a token */ @@ -232,7 +232,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), petstore.ContextAPIKeys, @@ -253,7 +253,7 @@ Note, each API key must be added to a map of `map[string]APIKey` where the key i Example -```golang +```go auth := context.WithValue( context.Background(), petstore.ContextAPIKeys, @@ -270,10 +270,10 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go auth := context.WithValue(context.Background(), petstore.ContextBasicAuth, petstore.BasicAuth{ - UserName: "username", - Password: "password", + UserName: "username", + Password: "password", }) r, err := client.Service.Operation(auth, args) ``` @@ -284,7 +284,7 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go auth := context.WithValue(context.Background(), petstore.ContextAccessToken, "BEARER_TOKEN_STRING") r, err := client.Service.Operation(auth, args) ``` @@ -295,7 +295,7 @@ r, err := client.Service.Operation(auth, args) Example -```golang +```go authConfig := petstore.HttpSignatureAuth{ KeyId: "my-key-id", PrivateKeyPath: "rsa.pem", diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md index d684cacbae79..3f01ccff9ef9 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/AnotherFakeAPI.md @@ -22,24 +22,24 @@ To test special tags package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - client := *openapiclient.NewClient() // Client | client model - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).Client(client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `Call123TestSpecialTags`: Client - fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp) + client := *openapiclient.NewClient() // Client | client model + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.AnotherFakeAPI.Call123TestSpecialTags(context.Background()).Client(client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `AnotherFakeAPI.Call123TestSpecialTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `Call123TestSpecialTags`: Client + fmt.Fprintf(os.Stdout, "Response from `AnotherFakeAPI.Call123TestSpecialTags`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md index b07855b1a535..70aee51f630b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/DefaultAPI.md @@ -20,23 +20,23 @@ Method | HTTP request | Description package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.DefaultAPI.FooGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.FooGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FooGet`: FooGetDefaultResponse - fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.FooGet`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.DefaultAPI.FooGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `DefaultAPI.FooGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FooGet`: FooGetDefaultResponse + fmt.Fprintf(os.Stdout, "Response from `DefaultAPI.FooGet`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md index 87d1d6443e91..50894e0d8d14 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeAPI.md @@ -37,23 +37,23 @@ Health check endpoint package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeHealthGet(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeHealthGet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeHealthGet`: HealthCheckResult - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeHealthGet`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeHealthGet(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeHealthGet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeHealthGet`: HealthCheckResult + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeHealthGet`: %v\n", resp) } ``` @@ -98,24 +98,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := true // bool | Input boolean as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterBooleanSerialize`: bool - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp) + body := true // bool | Input boolean as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterBooleanSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterBooleanSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterBooleanSerialize`: bool + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterBooleanSerialize`: %v\n", resp) } ``` @@ -164,24 +164,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - outerComposite := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterCompositeSerialize`: OuterComposite - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp) + outerComposite := *openapiclient.NewOuterComposite() // OuterComposite | Input composite as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterCompositeSerialize(context.Background()).OuterComposite(outerComposite).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterCompositeSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterCompositeSerialize`: OuterComposite + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterCompositeSerialize`: %v\n", resp) } ``` @@ -230,24 +230,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := float32(8.14) // float32 | Input number as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterNumberSerialize`: float32 - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp) + body := float32(8.14) // float32 | Input number as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterNumberSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterNumberSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterNumberSerialize`: float32 + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterNumberSerialize`: %v\n", resp) } ``` @@ -296,24 +296,24 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - body := "body_example" // string | Input string as post body (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FakeOuterStringSerialize`: string - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp) + body := "body_example" // string | Input string as post body (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.FakeOuterStringSerialize(context.Background()).Body(body).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.FakeOuterStringSerialize``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FakeOuterStringSerialize`: string + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.FakeOuterStringSerialize`: %v\n", resp) } ``` @@ -360,25 +360,25 @@ parameter name mapping test package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - underscoreType := int64(789) // int64 | _type - type_ := "type__example" // string | type - typeWithUnderscore := "typeWithUnderscore_example" // string | type_ - httpDebugOption := "httpDebugOption_example" // string | http debug option (to test parameter naming option) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.GetParameterNameMapping(context.Background()).UnderscoreType(underscoreType).Type_(type_).TypeWithUnderscore(typeWithUnderscore).HttpDebugOption(httpDebugOption).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.GetParameterNameMapping``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + underscoreType := int64(789) // int64 | _type + type_ := "type__example" // string | type + typeWithUnderscore := "typeWithUnderscore_example" // string | type_ + httpDebugOption := "httpDebugOption_example" // string | http debug option (to test parameter naming option) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.GetParameterNameMapping(context.Background()).UnderscoreType(underscoreType).Type_(type_).TypeWithUnderscore(typeWithUnderscore).HttpDebugOption(httpDebugOption).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.GetParameterNameMapping``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -430,22 +430,22 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - fileSchemaTestClass := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + fileSchemaTestClass := *openapiclient.NewFileSchemaTestClass() // FileSchemaTestClass | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestBodyWithFileSchema(context.Background()).FileSchemaTestClass(fileSchemaTestClass).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithFileSchema``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -492,23 +492,23 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - query := "query_example" // string | - user := *openapiclient.NewUser() // User | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + query := "query_example" // string | + user := *openapiclient.NewUser() // User | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestBodyWithQueryParams(context.Background()).Query(query).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestBodyWithQueryParams``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -558,24 +558,24 @@ To test \"client\" model package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - client := *openapiclient.NewClient() // Client | client model - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Client(client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClientModel`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp) + client := *openapiclient.NewClient() // Client | client model + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.TestClientModel(context.Background()).Client(client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestClientModel``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClientModel`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestClientModel`: %v\n", resp) } ``` @@ -624,36 +624,36 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン package main import ( - "context" - "fmt" - "os" + "context" + "fmt" + "os" "time" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - number := float32(8.14) // float32 | None - double := float64(1.2) // float64 | None - patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None - byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None - integer := int32(56) // int32 | None (optional) - int32_ := int32(56) // int32 | None (optional) - int64_ := int64(789) // int64 | None (optional) - float := float32(3.4) // float32 | None (optional) - string_ := "string__example" // string | None (optional) - binary := os.NewFile(1234, "some_file") // *os.File | None (optional) - date := time.Now() // string | None (optional) - dateTime := time.Now() // time.Time | None (optional) - password := "password_example" // string | None (optional) - callback := "callback_example" // string | None (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + number := float32(8.14) // float32 | None + double := float64(1.2) // float64 | None + patternWithoutDelimiter := "patternWithoutDelimiter_example" // string | None + byte_ := string(BYTE_ARRAY_DATA_HERE) // string | None + integer := int32(56) // int32 | None (optional) + int32_ := int32(56) // int32 | None (optional) + int64_ := int64(789) // int64 | None (optional) + float := float32(3.4) // float32 | None (optional) + string_ := "string__example" // string | None (optional) + binary := os.NewFile(1234, "some_file") // *os.File | None (optional) + date := time.Now() // string | None (optional) + dateTime := time.Now() // time.Time | None (optional) + password := "password_example" // string | None (optional) + callback := "callback_example" // string | None (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestEndpointParameters(context.Background()).Number(number).Double(double).PatternWithoutDelimiter(patternWithoutDelimiter).Byte_(byte_).Integer(integer).Int32_(int32_).Int64_(int64_).Float(float).String_(string_).Binary(binary).Date(date).DateTime(dateTime).Password(password).Callback(callback).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEndpointParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -715,29 +715,29 @@ To test enum parameters package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) - enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") - enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) - enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") - enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional) - enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional) - enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") - enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + enumHeaderStringArray := []string{"EnumHeaderStringArray_example"} // []string | Header parameter enum test (string array) (optional) + enumHeaderString := "enumHeaderString_example" // string | Header parameter enum test (string) (optional) (default to "-efg") + enumQueryStringArray := []string{"EnumQueryStringArray_example"} // []string | Query parameter enum test (string array) (optional) + enumQueryString := "enumQueryString_example" // string | Query parameter enum test (string) (optional) (default to "-efg") + enumQueryInteger := int32(56) // int32 | Query parameter enum test (double) (optional) + enumQueryDouble := float64(1.2) // float64 | Query parameter enum test (double) (optional) + enumFormStringArray := []string{"Inner_example"} // []string | Form parameter enum test (string array) (optional) (default to "$") + enumFormString := "enumFormString_example" // string | Form parameter enum test (string) (optional) (default to "-efg") + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestEnumParameters(context.Background()).EnumHeaderStringArray(enumHeaderStringArray).EnumHeaderString(enumHeaderString).EnumQueryStringArray(enumQueryStringArray).EnumQueryString(enumQueryString).EnumQueryInteger(enumQueryInteger).EnumQueryDouble(enumQueryDouble).EnumFormStringArray(enumFormStringArray).EnumFormString(enumFormString).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestEnumParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -793,27 +793,27 @@ Fake endpoint to test group parameters (optional) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - requiredStringGroup := int32(56) // int32 | Required String in group parameters - requiredBooleanGroup := true // bool | Required Boolean in group parameters - requiredInt64Group := int64(789) // int64 | Required Integer in group parameters - stringGroup := int32(56) // int32 | String in group parameters (optional) - booleanGroup := true // bool | Boolean in group parameters (optional) - int64Group := int64(789) // int64 | Integer in group parameters (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + requiredStringGroup := int32(56) // int32 | Required String in group parameters + requiredBooleanGroup := true // bool | Required Boolean in group parameters + requiredInt64Group := int64(789) // int64 | Required Integer in group parameters + stringGroup := int32(56) // int32 | String in group parameters (optional) + booleanGroup := true // bool | Boolean in group parameters (optional) + int64Group := int64(789) // int64 | Integer in group parameters (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestGroupParameters(context.Background()).RequiredStringGroup(requiredStringGroup).RequiredBooleanGroup(requiredBooleanGroup).RequiredInt64Group(requiredInt64Group).StringGroup(stringGroup).BooleanGroup(booleanGroup).Int64Group(int64Group).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestGroupParameters``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -867,22 +867,22 @@ test inline additionalProperties package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - requestBody := map[string]string{"key": "Inner_example"} // map[string]string | request body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + requestBody := map[string]string{"key": "Inner_example"} // map[string]string | request body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestInlineAdditionalProperties(context.Background()).RequestBody(requestBody).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineAdditionalProperties``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -931,22 +931,22 @@ test inline free-form additionalProperties package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - testInlineFreeformAdditionalPropertiesRequest := *openapiclient.NewTestInlineFreeformAdditionalPropertiesRequest() // TestInlineFreeformAdditionalPropertiesRequest | request body - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestInlineFreeformAdditionalProperties(context.Background()).TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineFreeformAdditionalProperties``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + testInlineFreeformAdditionalPropertiesRequest := *openapiclient.NewTestInlineFreeformAdditionalPropertiesRequest() // TestInlineFreeformAdditionalPropertiesRequest | request body + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestInlineFreeformAdditionalProperties(context.Background()).TestInlineFreeformAdditionalPropertiesRequest(testInlineFreeformAdditionalPropertiesRequest).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestInlineFreeformAdditionalProperties``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -995,23 +995,23 @@ test json serialization of form data package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - param := "param_example" // string | field1 - param2 := "param2_example" // string | field2 - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + param := "param_example" // string | field1 + param2 := "param2_example" // string | field2 + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestJsonFormData(context.Background()).Param(param).Param2(param2).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestJsonFormData``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1059,23 +1059,23 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - testPet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional) - inputOptions := *openapiclient.NewCategory("Name_example") // Category | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestQueryDeepObject(context.Background()).TestPet(testPet).InputOptions(inputOptions).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryDeepObject``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + testPet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | (optional) + inputOptions := *openapiclient.NewCategory("Name_example") // Category | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestQueryDeepObject(context.Background()).TestPet(testPet).InputOptions(inputOptions).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryDeepObject``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1125,26 +1125,26 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pipe := []string{"Inner_example"} // []string | - ioutil := []string{"Inner_example"} // []string | - http := []string{"Inner_example"} // []string | - url := []string{"Inner_example"} // []string | - context := []string{"Inner_example"} // []string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + pipe := []string{"Inner_example"} // []string | + ioutil := []string{"Inner_example"} // []string | + http := []string{"Inner_example"} // []string | + url := []string{"Inner_example"} // []string | + context := []string{"Inner_example"} // []string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.FakeAPI.TestQueryParameterCollectionFormat(context.Background()).Pipe(pipe).Ioutil(ioutil).Http(http).Url(url).Context(context).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestQueryParameterCollectionFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -1197,25 +1197,25 @@ No authorization required package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - queryUnique := []string{"Inner_example"} // []string | - headerUnique := []string{"Inner_example"} // []string | - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat(context.Background()).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: []Pet - fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: %v\n", resp) + queryUnique := []string{"Inner_example"} // []string | + headerUnique := []string{"Inner_example"} // []string | + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat(context.Background()).QueryUnique(queryUnique).HeaderUnique(headerUnique).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: []Pet + fmt.Fprintf(os.Stdout, "Response from `FakeAPI.TestUniqueItemsHeaderAndQueryParameterCollectionFormat`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md index 07adebe5325c..ad04c336e9f5 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/FakeClassnameTags123API.md @@ -22,24 +22,24 @@ To test class name in snake case package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - client := *openapiclient.NewClient() // Client | client model - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Client(client).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `TestClassname`: Client - fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp) + client := *openapiclient.NewClient() // Client | client model + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.FakeClassnameTags123API.TestClassname(context.Background()).Client(client).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `FakeClassnameTags123API.TestClassname``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `TestClassname`: Client + fmt.Fprintf(os.Stdout, "Response from `FakeClassnameTags123API.TestClassname`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/PetAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/PetAPI.md index 74c734b684ac..f034e1b6c6fd 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/PetAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/PetAPI.md @@ -30,22 +30,22 @@ Add a new pet to the store package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.AddPet(context.Background()).Pet(pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.AddPet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -94,23 +94,23 @@ Deletes a pet package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | Pet id to delete - apiKey := "apiKey_example" // string | (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + petId := int64(789) // int64 | Pet id to delete + apiKey := "apiKey_example" // string | (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.DeletePet(context.Background(), petId).ApiKey(apiKey).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.DeletePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -164,24 +164,24 @@ Finds Pets by status package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - status := []string{"Status_example"} // []string | Status values that need to be considered for filter - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByStatus`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp) + status := []string{"Status_example"} // []string | Status values that need to be considered for filter + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.FindPetsByStatus(context.Background()).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByStatus``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByStatus`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByStatus`: %v\n", resp) } ``` @@ -230,24 +230,24 @@ Finds Pets by tags package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - tags := []string{"Inner_example"} // []string | Tags to filter by - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `FindPetsByTags`: []Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp) + tags := []string{"Inner_example"} // []string | Tags to filter by + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.FindPetsByTags(context.Background()).Tags(tags).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.FindPetsByTags``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `FindPetsByTags`: []Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.FindPetsByTags`: %v\n", resp) } ``` @@ -296,24 +296,24 @@ Find pet by ID package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet to return - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetPetById`: Pet - fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp) + petId := int64(789) // int64 | ID of pet to return + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.GetPetById(context.Background(), petId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.GetPetById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetPetById`: Pet + fmt.Fprintf(os.Stdout, "Response from `PetAPI.GetPetById`: %v\n", resp) } ``` @@ -366,22 +366,22 @@ Update an existing pet package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.UpdatePet(context.Background()).Pet(pet).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + pet := *openapiclient.NewPet("doggie", []string{"PhotoUrls_example"}) // Pet | Pet object that needs to be added to the store + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.UpdatePet(context.Background()).Pet(pet).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePet``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -430,24 +430,24 @@ Updates a pet in the store with form data package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet that needs to be updated - name := "name_example" // string | Updated name of the pet (optional) - status := "status_example" // string | Updated status of the pet (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + petId := int64(789) // int64 | ID of pet that needs to be updated + name := "name_example" // string | Updated name of the pet (optional) + status := "status_example" // string | Updated status of the pet (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.PetAPI.UpdatePetWithForm(context.Background(), petId).Name(name).Status(status).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UpdatePetWithForm``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -502,26 +502,26 @@ uploads an image package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet to update - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp) + petId := int64(789) // int64 | ID of pet to update + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + file := os.NewFile(1234, "some_file") // *os.File | file to upload (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.UploadFile(context.Background(), petId).AdditionalMetadata(additionalMetadata).File(file).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFile`: %v\n", resp) } ``` @@ -576,26 +576,26 @@ uploads an image (required) package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - petId := int64(789) // int64 | ID of pet to update - requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload - additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `UploadFileWithRequiredFile`: ApiResponse - fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp) + petId := int64(789) // int64 | ID of pet to update + requiredFile := os.NewFile(1234, "some_file") // *os.File | file to upload + additionalMetadata := "additionalMetadata_example" // string | Additional data to pass to server (optional) + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.PetAPI.UploadFileWithRequiredFile(context.Background(), petId).RequiredFile(requiredFile).AdditionalMetadata(additionalMetadata).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `PetAPI.UploadFileWithRequiredFile``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `UploadFileWithRequiredFile`: ApiResponse + fmt.Fprintf(os.Stdout, "Response from `PetAPI.UploadFileWithRequiredFile`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreAPI.md index a1b97436465f..441c9dc8393b 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/StoreAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/StoreAPI.md @@ -25,22 +25,22 @@ Delete purchase order by ID package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - orderId := "orderId_example" // string | ID of the order that needs to be deleted - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + orderId := "orderId_example" // string | ID of the order that needs to be deleted + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.StoreAPI.DeleteOrder(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.DeleteOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -93,23 +93,23 @@ Returns pet inventories by status package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetInventory`: map[string]int32 - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp) + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.GetInventory(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetInventory``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetInventory`: map[string]int32 + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetInventory`: %v\n", resp) } ``` @@ -154,24 +154,24 @@ Find purchase order by ID package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - orderId := int64(789) // int64 | ID of pet that needs to be fetched - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetOrderById`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp) + orderId := int64(789) // int64 | ID of pet that needs to be fetched + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.GetOrderById(context.Background(), orderId).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.GetOrderById``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetOrderById`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.GetOrderById`: %v\n", resp) } ``` @@ -224,24 +224,24 @@ Place an order for a pet package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - order := *openapiclient.NewOrder() // Order | order placed for purchasing the pet - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Order(order).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `PlaceOrder`: Order - fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp) + order := *openapiclient.NewOrder() // Order | order placed for purchasing the pet + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.StoreAPI.PlaceOrder(context.Background()).Order(order).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `StoreAPI.PlaceOrder``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `PlaceOrder`: Order + fmt.Fprintf(os.Stdout, "Response from `StoreAPI.PlaceOrder`: %v\n", resp) } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/docs/UserAPI.md b/samples/openapi3/client/petstore/go/go-petstore/docs/UserAPI.md index 03cb03aef2c1..62ee16ad0204 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/docs/UserAPI.md +++ b/samples/openapi3/client/petstore/go/go-petstore/docs/UserAPI.md @@ -29,22 +29,22 @@ Create user package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - user := *openapiclient.NewUser() // User | Created user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.CreateUser(context.Background()).User(user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + user := *openapiclient.NewUser() // User | Created user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.CreateUser(context.Background()).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -93,22 +93,22 @@ Creates list of users with given input array package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).User(user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.CreateUsersWithArrayInput(context.Background()).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithArrayInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -157,22 +157,22 @@ Creates list of users with given input array package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).User(user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + user := []openapiclient.User{*openapiclient.NewUser()} // []User | List of user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.CreateUsersWithListInput(context.Background()).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.CreateUsersWithListInput``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -221,22 +221,22 @@ Delete user package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | The name that needs to be deleted - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + username := "username_example" // string | The name that needs to be deleted + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.DeleteUser(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.DeleteUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -289,24 +289,24 @@ Get user by user name package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `GetUserByName`: User - fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp) + username := "username_example" // string | The name that needs to be fetched. Use user1 for testing. + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.GetUserByName(context.Background(), username).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.GetUserByName``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `GetUserByName`: User + fmt.Fprintf(os.Stdout, "Response from `UserAPI.GetUserByName`: %v\n", resp) } ``` @@ -359,25 +359,25 @@ Logs user into the system package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | The user name for login - password := "password_example" // string | The password for login in clear text - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } - // response from `LoginUser`: string - fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp) + username := "username_example" // string | The user name for login + password := "password_example" // string | The password for login in clear text + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + resp, r, err := apiClient.UserAPI.LoginUser(context.Background()).Username(username).Password(password).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LoginUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } + // response from `LoginUser`: string + fmt.Fprintf(os.Stdout, "Response from `UserAPI.LoginUser`: %v\n", resp) } ``` @@ -427,21 +427,21 @@ Logs out current logged in user session package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.LogoutUser(context.Background()).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.LogoutUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` @@ -486,23 +486,23 @@ Updated user package main import ( - "context" - "fmt" - "os" - openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" + "context" + "fmt" + "os" + openapiclient "github.com/GIT_USER_ID/GIT_REPO_ID" ) func main() { - username := "username_example" // string | name that need to be deleted - user := *openapiclient.NewUser() // User | Updated user object - - configuration := openapiclient.NewConfiguration() - apiClient := openapiclient.NewAPIClient(configuration) - r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).User(user).Execute() - if err != nil { - fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err) - fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) - } + username := "username_example" // string | name that need to be deleted + user := *openapiclient.NewUser() // User | Updated user object + + configuration := openapiclient.NewConfiguration() + apiClient := openapiclient.NewAPIClient(configuration) + r, err := apiClient.UserAPI.UpdateUser(context.Background(), username).User(user).Execute() + if err != nil { + fmt.Fprintf(os.Stderr, "Error when calling `UserAPI.UpdateUser``: %v\n", err) + fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) + } } ``` diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go index 43c57d16ca47..14546b6f60a3 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_animal.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_animal.go @@ -128,7 +128,7 @@ func (o Animal) ToMap() (map[string]interface{}, error) { } func (o *Animal) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go index 72eac7b3602d..648c2cc411d1 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_apple_req.go @@ -124,7 +124,7 @@ func (o AppleReq) ToMap() (map[string]interface{}, error) { } func (o *AppleReq) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go index 2c9381772f41..8388eef20f96 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_banana_req.go @@ -124,7 +124,7 @@ func (o BananaReq) ToMap() (map[string]interface{}, error) { } func (o *BananaReq) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go index c01f8d5d0993..45bdca7e290e 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_cat.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_cat.go @@ -111,7 +111,7 @@ func (o Cat) ToMap() (map[string]interface{}, error) { } func (o *Cat) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_category.go b/samples/openapi3/client/petstore/go/go-petstore/model_category.go index 7f6f7865a46b..627af9f525b7 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_category.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_category.go @@ -126,7 +126,7 @@ func (o Category) ToMap() (map[string]interface{}, error) { } func (o *Category) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go index 0b9680238fec..19e27035662d 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_dog.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_dog.go @@ -111,7 +111,7 @@ func (o Dog) ToMap() (map[string]interface{}, error) { } func (o *Dog) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go index f378abf406a8..84a110309e8c 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_duplicated_prop_parent.go @@ -89,7 +89,7 @@ func (o DuplicatedPropParent) ToMap() (map[string]interface{}, error) { } func (o *DuplicatedPropParent) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go index 317d3112bb65..e46727a3d489 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_enum_test_.go @@ -358,7 +358,7 @@ func (o EnumTest) ToMap() (map[string]interface{}, error) { } func (o *EnumTest) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go index 1fa58f722323..372145bce942 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_format_test_.go @@ -569,7 +569,7 @@ func (o FormatTest) ToMap() (map[string]interface{}, error) { } func (o *FormatTest) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_name.go b/samples/openapi3/client/petstore/go/go-petstore/model_name.go index ef0bece258a3..5ced23756c63 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_name.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_name.go @@ -196,7 +196,7 @@ func (o Name) ToMap() (map[string]interface{}, error) { } func (o *Name) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go index d6f1a0a016f2..7f92f5d7e116 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_pet.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_pet.go @@ -264,7 +264,7 @@ func (o Pet) ToMap() (map[string]interface{}, error) { } func (o *Pet) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_whale.go b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go index a9810a7321d4..17cdc48296bf 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_whale.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_whale.go @@ -160,7 +160,7 @@ func (o Whale) ToMap() (map[string]interface{}, error) { } func (o *Whale) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go index 41daab4f63dd..192d6954e440 100644 --- a/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go +++ b/samples/openapi3/client/petstore/go/go-petstore/model_zebra.go @@ -124,7 +124,7 @@ func (o Zebra) ToMap() (map[string]interface{}, error) { } func (o *Zebra) UnmarshalJSON(bytes []byte) (err error) { - // This validates that all required properties are included in the JSON object + // This validates that all required properties are included in the JSON object // by unmarshalling the object into a generic map with string keys and checking // that every required field exists as a key in the generic map. requiredProperties := []string{ diff --git a/samples/server/petstore/go-echo-server/handlers/api_pet.go b/samples/server/petstore/go-echo-server/handlers/api_pet.go index af6117b162bc..865529ccc9e8 100644 --- a/samples/server/petstore/go-echo-server/handlers/api_pet.go +++ b/samples/server/petstore/go-echo-server/handlers/api_pet.go @@ -1,70 +1,71 @@ package handlers import ( - "gitlab.com/openapitools/petstore/models" - "github.com/labstack/echo/v4" - "net/http" + "gitlab.com/openapitools/petstore/models" + "github.com/labstack/echo/v4" + "net/http" ) // AddPet - Add a new pet to the store func (c *Container) AddPet(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // DeletePet - Deletes a pet func (c *Container) DeletePet(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // FindPetsByStatus - Finds Pets by status func (c *Container) FindPetsByStatus(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // FindPetsByTags - Finds Pets by tags // Deprecated func (c *Container) FindPetsByTags(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // GetPetById - Find pet by ID func (c *Container) GetPetById(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // UpdatePet - Update an existing pet func (c *Container) UpdatePet(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // UpdatePetWithForm - Updates a pet in the store with form data func (c *Container) UpdatePetWithForm(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // UploadFile - uploads an image func (c *Container) UploadFile(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } + diff --git a/samples/server/petstore/go-echo-server/handlers/api_store.go b/samples/server/petstore/go-echo-server/handlers/api_store.go index a994e5020a72..a196ab87e295 100644 --- a/samples/server/petstore/go-echo-server/handlers/api_store.go +++ b/samples/server/petstore/go-echo-server/handlers/api_store.go @@ -1,37 +1,38 @@ package handlers import ( - "gitlab.com/openapitools/petstore/models" - "github.com/labstack/echo/v4" - "net/http" + "gitlab.com/openapitools/petstore/models" + "github.com/labstack/echo/v4" + "net/http" ) // DeleteOrder - Delete purchase order by ID func (c *Container) DeleteOrder(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // GetInventory - Returns pet inventories by status func (c *Container) GetInventory(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // GetOrderById - Find purchase order by ID func (c *Container) GetOrderById(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // PlaceOrder - Place an order for a pet func (c *Container) PlaceOrder(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } + diff --git a/samples/server/petstore/go-echo-server/handlers/api_user.go b/samples/server/petstore/go-echo-server/handlers/api_user.go index 8f695e3c7d33..1e1e03de8bed 100644 --- a/samples/server/petstore/go-echo-server/handlers/api_user.go +++ b/samples/server/petstore/go-echo-server/handlers/api_user.go @@ -1,69 +1,70 @@ package handlers import ( - "gitlab.com/openapitools/petstore/models" - "github.com/labstack/echo/v4" - "net/http" + "gitlab.com/openapitools/petstore/models" + "github.com/labstack/echo/v4" + "net/http" ) // CreateUser - Create user func (c *Container) CreateUser(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // CreateUsersWithArrayInput - Creates list of users with given input array func (c *Container) CreateUsersWithArrayInput(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // CreateUsersWithListInput - Creates list of users with given input array func (c *Container) CreateUsersWithListInput(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // DeleteUser - Delete user func (c *Container) DeleteUser(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // GetUserByName - Get user by user name func (c *Container) GetUserByName(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // LoginUser - Logs user into the system func (c *Container) LoginUser(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // LogoutUser - Logs out current logged in user session func (c *Container) LogoutUser(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } // UpdateUser - Updated user func (c *Container) UpdateUser(ctx echo.Context) error { - return ctx.JSON(http.StatusOK, models.HelloWorld { - Message: "Hello World", - }) + return ctx.JSON(http.StatusOK, models.HelloWorld { + Message: "Hello World", + }) } + diff --git a/samples/server/petstore/go-echo-server/handlers/container.go b/samples/server/petstore/go-echo-server/handlers/container.go index 330a32f51534..2e4aa441e22c 100644 --- a/samples/server/petstore/go-echo-server/handlers/container.go +++ b/samples/server/petstore/go-echo-server/handlers/container.go @@ -6,6 +6,6 @@ type Container struct { // NewContainer returns an empty or an initialized container for your handlers. func NewContainer() (Container, error) { - c := Container{} - return c, nil -} \ No newline at end of file + c := Container{} + return c, nil +} diff --git a/samples/server/petstore/go-echo-server/main.go b/samples/server/petstore/go-echo-server/main.go index b96dcb776ef5..8e1095eaee45 100644 --- a/samples/server/petstore/go-echo-server/main.go +++ b/samples/server/petstore/go-echo-server/main.go @@ -9,7 +9,7 @@ import ( func main() { e := echo.New() - //todo: handle the error! + //todo: handle the error! c, _ := handlers.NewContainer() // Middleware @@ -80,4 +80,4 @@ func main() { // Start server e.Logger.Fatal(e.Start(":8080")) -} \ No newline at end of file +} diff --git a/samples/server/petstore/go-echo-server/models/hello-world.go b/samples/server/petstore/go-echo-server/models/hello-world.go index 98b4d20cb613..b939ad04f792 100644 --- a/samples/server/petstore/go-echo-server/models/hello-world.go +++ b/samples/server/petstore/go-echo-server/models/hello-world.go @@ -2,5 +2,5 @@ package models // HelloWorld is a sample data structure to make sure each endpoint return something. type HelloWorld struct { - Message string `json:"message"` -} \ No newline at end of file + Message string `json:"message"` +}