[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`
This commit is contained in:
TAKAHiRO TOMiNAGA 2023-12-10 11:13:49 +09:00 committed by GitHub
parent 10da7a3c5a
commit 004c7e8c8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 1698 additions and 1695 deletions

View File

@ -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}}

View File

@ -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
c := Container{}
return c, nil
}

View File

@ -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"`
Message string `json:"message"`
}

View File

@ -9,7 +9,7 @@ import (
func main() {
e := echo.New()
//todo: handle the error!
//todo: handle the error!
c, _ := handlers.NewContainer()
// Middleware

View File

@ -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 */

View File

@ -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}}
{{#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}}
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}}
}
```

View File

@ -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{

View File

@ -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)
```

View File

@ -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)
}
```

View File

@ -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)
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)
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 |
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
}
```

View File

@ -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)
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)
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)
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)
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)
}
```

View File

@ -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)
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)
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)
}
```

View File

@ -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 |
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)
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)
}
```

View File

@ -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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
}
```

View File

@ -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{

View File

@ -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)
```

View File

@ -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
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)
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)
}
```

View File

@ -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
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)
}
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)
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)
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)
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)
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)
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)
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)
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)
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 |
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)
}
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 |
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)
}
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
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)
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)
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)
}
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")
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)
}
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)
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)
}
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
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)
}
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
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)
}
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 |
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)
}
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)
}
}
```

View File

@ -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
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)
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)
}
```

View File

@ -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
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)
}
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)
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)
}
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
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)
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
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)
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
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)
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
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)
}
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)
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)
}
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)
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)
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)
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)
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)
}
```

View File

@ -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
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)
}
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
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)
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
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)
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)
}
```

View File

@ -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
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)
}
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
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)
}
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
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)
}
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
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)
}
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.
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)
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
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)
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
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)
}
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)
}
}
```

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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,

View File

@ -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)
}
```

View File

@ -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 */

View File

@ -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
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)
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)
}
```

View File

@ -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{

View File

@ -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",

View File

@ -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
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)
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)
}
```

View File

@ -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)
}
```

View File

@ -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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
}
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 |
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)
}
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 |
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)
}
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
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)
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)
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)
}
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")
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)
}
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)
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)
}
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
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)
}
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
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)
}
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
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)
}
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)
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)
}
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 |
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)
}
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 |
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)
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)
}
```

View File

@ -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
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)
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)
}
```

View File

@ -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
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)
}
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)
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)
}
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
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)
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
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)
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
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)
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
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)
}
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)
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)
}
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)
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)
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)
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)
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)
}
```

View File

@ -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
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)
}
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
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)
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
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)
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)
}
```

View File

@ -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
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)
}
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
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)
}
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
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)
}
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
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)
}
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.
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)
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
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)
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
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)
}
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)
}
}
```

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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{

View File

@ -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",
})
}

View File

@ -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",
})
}

View File

@ -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",
})
}

View File

@ -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
c := Container{}
return c, nil
}

View File

@ -9,7 +9,7 @@ import (
func main() {
e := echo.New()
//todo: handle the error!
//todo: handle the error!
c, _ := handlers.NewContainer()
// Middleware

View File

@ -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"`
Message string `json:"message"`
}