mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
Rename environment variable for Go to post-process file (#1091)
* renmae Go post process file env variable * add back samples/client/petstore/c/libcurl.licence * keep go samples up-to-date * update go petstore samples * update go samples without formatting
This commit is contained in:
@@ -10,7 +10,8 @@ if [ "$NODE_INDEX" = "1" ]; then
|
||||
mvn --quiet verify -Psamples
|
||||
elif [ "$NODE_INDEX" = "2" ]; then
|
||||
echo "Running node $NODE_INDEX to test ensure-up-to-date"
|
||||
export GO_FMT_PATH=`which gofmt`
|
||||
#export GO_POST_PROCESS_FILE="/usr/local/bin/gofmt -w"
|
||||
# not formatting the code as different go versions may format the code a bit different
|
||||
./bin/utils/ensure-up-to-date
|
||||
else
|
||||
echo "Running node $NODE_INDEX to test CI/pom.xml.circleci.java7 ..."
|
||||
|
||||
@@ -43,7 +43,7 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
| | Languages/Frameworks |
|
||||
|-|-|
|
||||
**API clients** | **ActionScript**, **Ada**, **Apex**, **Bash**, **C#** (.net 2.0, 3.5 or later), **C++** (cpprest, Qt5, Tizen), **Clojure**, **Dart (1.x, 2.x)**, **Elixir**, **Elm**, **Eiffel**, **Erlang**, **Go**, **Groovy**, **Haskell** (http-client, Servant), **Java** (Jersey1.x, Jersey2.x, OkHttp, Retrofit1.x, Retrofit2.x, Feign, RestTemplate, RESTEasy, Vertx, Google API Client Library for Java, Rest-assured, Spring 5 Web Client), **Kotlin**, **Lua**, **Node.js** (ES5, ES6, AngularJS with Google Closure Compiler annotations, Flow types) **Objective-C**, **Perl**, **PHP**, **PowerShell**, **Python**, **R**, **Ruby**, **Rust** (rust, rust-server), **Scala** (akka, http4s, scalaz, swagger-async-httpclient), **Swift** (2.x, 3.x, 4.x), **Typescript** (AngularJS, Angular (2.x - 6.x), Aurelia, Axios, Fetch, Inversify, jQuery, Node)
|
||||
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go**, **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra)
|
||||
**Server stubs** | **Ada**, **C#** (ASP.NET Core, NancyFx), **C++** (Pistache, Restbed), **Erlang**, **Go** (net/http, Gin), **Haskell** (Servant), **Java** (MSF4J, Spring, Undertow, JAX-RS: CDI, CXF, Inflector, RestEasy, Play Framework, [PKMST](https://github.com/ProKarma-Inc/pkmst-getting-started-examples)), **Kotlin** (Spring Boot), **PHP** (Laravel, Lumen, Slim, Silex, [Symfony](https://symfony.com/), [Zend Expressive](https://github.com/zendframework/zend-expressive)), **Python** (Flask), **NodeJS**, **Ruby** (Sinatra, Rails5), **Rust** (rust-server), **Scala** ([Finch](https://github.com/finagle/finch), [Lagom](https://github.com/lagom/lagom), Scalatra)
|
||||
**API documentation generators** | **HTML**, **Confluence Wiki**
|
||||
**Configuration files** | [**Apache2**](https://httpd.apache.org/)
|
||||
**Others** | **JMeter**, **MySQL Schema**
|
||||
@@ -577,6 +577,7 @@ Here is a list of template creators:
|
||||
* C++ Restbed: @stkrwork
|
||||
* Erlang Server: @galaxie
|
||||
* Go Server: @guohuang
|
||||
* Go (Gin) Server: @kemokemo
|
||||
* Haskell Servant: @algas
|
||||
* Java MSF4J: @sanjeewa-malalgoda
|
||||
* Java Spring Boot: @diyfr
|
||||
@@ -650,7 +651,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Elixir | |
|
||||
| Elm | @trenneman (2018/09) |
|
||||
| Erlang | @tsloughter (2017/11) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) @kemokemo (2018/09 |
|
||||
| Groovy | |
|
||||
| Haskell | |
|
||||
| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) |
|
||||
|
||||
@@ -35,6 +35,7 @@ sleep 5
|
||||
./bin/csharp-petstore.sh > /dev/null 2>&1
|
||||
./bin/meta-codegen.sh > /dev/null 2>&1
|
||||
./bin/utils/export_docs_generators.sh > /dev/null 2>&1
|
||||
./bin/go-petstore.sh > /dev/null 2>&1
|
||||
./bin/go-gin-petstore-server.sh > /dev/null 2>&1
|
||||
|
||||
# Check:
|
||||
|
||||
37
docs/generators/dart-jaguar.md
Normal file
37
docs/generators/dart-jaguar.md
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
CONFIG OPTIONS for dart-jaguar
|
||||
|
||||
sortParamsByRequiredFlag
|
||||
Sort method arguments to place required parameters before optional parameters. (Default: true)
|
||||
|
||||
ensureUniqueParams
|
||||
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)
|
||||
|
||||
allowUnicodeIdentifiers
|
||||
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)
|
||||
|
||||
prependFormOrBodyParameters
|
||||
Add form or body parameters to the beginning of the parameter list. (Default: false)
|
||||
|
||||
browserClient
|
||||
Is the client browser based
|
||||
|
||||
pubName
|
||||
Name in generated pubspec
|
||||
|
||||
pubVersion
|
||||
Version in generated pubspec
|
||||
|
||||
pubDescription
|
||||
Description in generated pubspec
|
||||
|
||||
useEnumExtension
|
||||
Allow the 'x-enum-values' extension for enums
|
||||
|
||||
sourceFolder
|
||||
source folder for generated code
|
||||
|
||||
supportDart2
|
||||
support dart2 (Default: true)
|
||||
|
||||
Back to the [generators list](README.md)
|
||||
37
docs/generators/typescript-axios.md
Normal file
37
docs/generators/typescript-axios.md
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
CONFIG OPTIONS for typescript-axios
|
||||
|
||||
sortParamsByRequiredFlag
|
||||
Sort method arguments to place required parameters before optional parameters. (Default: true)
|
||||
|
||||
ensureUniqueParams
|
||||
Whether to ensure parameter names are unique in an operation (rename parameters that are not). (Default: true)
|
||||
|
||||
allowUnicodeIdentifiers
|
||||
boolean, toggles whether unicode identifiers are allowed in names or not, default is false (Default: false)
|
||||
|
||||
prependFormOrBodyParameters
|
||||
Add form or body parameters to the beginning of the parameter list. (Default: false)
|
||||
|
||||
modelPropertyNaming
|
||||
Naming convention for the property: 'camelCase', 'PascalCase', 'snake_case' and 'original', which keeps the original name (Default: camelCase)
|
||||
|
||||
supportsES6
|
||||
Generate code that conforms to ES6. (Default: false)
|
||||
|
||||
npmName
|
||||
The name under which you want to publish generated npm package
|
||||
|
||||
npmVersion
|
||||
The version of your npm package
|
||||
|
||||
npmRepository
|
||||
Use this property to set an url your private npmRepo in the package.json
|
||||
|
||||
snapshot
|
||||
When setting this property to true the version will be suffixed with -SNAPSHOT.yyyyMMddHHmm (Default: false)
|
||||
|
||||
withInterfaces
|
||||
Setting this property to true will generate interfaces next to the default class implementations. (Default: false)
|
||||
|
||||
Back to the [generators list](README.md)
|
||||
@@ -115,6 +115,15 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
.defaultValue(Boolean.TRUE.toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
if (StringUtils.isEmpty(System.getenv("GO_POST_PROCESS_FILE"))) {
|
||||
LOGGER.info("Environment variable GO_POST_PROCESS_FILE not defined so Go code may not be properly formatted. To define it, try `export GO_POST_PROCESS_FILE=\"/usr/local/bin/gofmt -w\"` (Linux/Mac)");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes a reserved word as defined in the `reservedWords` array. Handle escaping
|
||||
* those terms here. This logic is only called if a variable matches the reserved words
|
||||
@@ -613,9 +622,9 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
return;
|
||||
}
|
||||
|
||||
String goFmtPath = System.getenv("GO_FMT_PATH");
|
||||
if (StringUtils.isEmpty(goFmtPath)) {
|
||||
return; // skip if GO_FMT_PATH env variable is not defined
|
||||
String goPostProcessFile = System.getenv("GO_POST_PROCESS_FILE");
|
||||
if (StringUtils.isEmpty(goPostProcessFile)) {
|
||||
return; // skip if GO_POST_PROCESS_FILE env variable is not defined
|
||||
}
|
||||
|
||||
// only procees the following type (or we can simply rely on the file extension to check if it's a Go file)
|
||||
@@ -632,16 +641,17 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
|
||||
// only process files with go extension
|
||||
if ("go".equals(FilenameUtils.getExtension(file.toString()))) {
|
||||
// currently only support "gofmt -w yourcode.go"
|
||||
// another way is "go fmt path/to/your/package"
|
||||
String command = goFmtPath + " -w " + file.toString();
|
||||
// e.g. "gofmt -w yourcode.go"
|
||||
// e.g. "go fmt path/to/your/package"
|
||||
String command = goPostProcessFile + " " + file.toString();
|
||||
try {
|
||||
Process p = Runtime.getRuntime().exec(command);
|
||||
p.waitFor();
|
||||
if (p.exitValue() != 0) {
|
||||
LOGGER.error("Error running the command ({}). Exit code: {}", command, p.exitValue());
|
||||
int exitValue = p.waitFor();
|
||||
if (exitValue != 0) {
|
||||
LOGGER.error("Error running the command ({}). Exit code: {}", command, exitValue);
|
||||
} else {
|
||||
LOGGER.info("Successfully executed: " + command);
|
||||
}
|
||||
LOGGER.info("Successfully executed: " + command);
|
||||
} catch (Exception e) {
|
||||
LOGGER.error("Error running the command ({}). Exception: {}", command, e.getMessage());
|
||||
}
|
||||
|
||||
@@ -71,10 +71,6 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
if (StringUtils.isEmpty(System.getenv("GO_FMT_PATH"))) {
|
||||
LOGGER.info("Environment variable GO_FMT_PATH not defined so Go code may not be properly formatted. To define it, try 'export GO_FMT_PATH=/usr/local/bin/gofmt' (Linux/Mac)");
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
} else {
|
||||
|
||||
@@ -106,10 +106,6 @@ public class GoGinServerCodegen extends AbstractGoCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
if (StringUtils.isEmpty(System.getenv("GO_FMT_PATH"))) {
|
||||
LOGGER.info("Environment variable GO_FMT_PATH not defined so Go code may not be properly formatted. To define it, try 'export GO_FMT_PATH=/usr/local/bin/gofmt' (Linux/Mac)");
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
} else {
|
||||
|
||||
@@ -90,10 +90,6 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
||||
public void processOpts() {
|
||||
super.processOpts();
|
||||
|
||||
if (StringUtils.isEmpty(System.getenv("GO_FMT_PATH"))) {
|
||||
LOGGER.info("Environment variable GO_FMT_PATH not defined so Go code may not be properly formatted. To define it, try 'export GO_FMT_PATH=/usr/local/bin/gofmt' (Linux/Mac)");
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
} else {
|
||||
|
||||
@@ -33,12 +33,12 @@ To test special tags and operation ID starting with number
|
||||
*/
|
||||
func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, client Client) (Client, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Client
|
||||
localVarReturnValue Client
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -85,7 +85,7 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, clie
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -93,18 +93,18 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx context.Context, clie
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Client
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -11,12 +11,12 @@ package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"github.com/antihax/optional"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@@ -36,17 +36,17 @@ Test serialization of outer boolean types
|
||||
*/
|
||||
|
||||
type FakeOuterBooleanSerializeOpts struct {
|
||||
Body optional.Bool
|
||||
Body optional.Bool
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (bool, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue bool
|
||||
localVarReturnValue bool
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -96,7 +96,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -104,18 +104,18 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v bool
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -133,17 +133,17 @@ Test serialization of object with outer number type
|
||||
*/
|
||||
|
||||
type FakeOuterCompositeSerializeOpts struct {
|
||||
OuterComposite optional.Interface
|
||||
OuterComposite optional.Interface
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue OuterComposite
|
||||
localVarReturnValue OuterComposite
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -197,7 +197,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -205,18 +205,18 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v OuterComposite
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -234,17 +234,17 @@ Test serialization of outer number types
|
||||
*/
|
||||
|
||||
type FakeOuterNumberSerializeOpts struct {
|
||||
Body optional.Float32
|
||||
Body optional.Float32
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (float32, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue float32
|
||||
localVarReturnValue float32
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -294,7 +294,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -302,18 +302,18 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v float32
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -331,17 +331,17 @@ Test serialization of outer string types
|
||||
*/
|
||||
|
||||
type FakeOuterStringSerializeOpts struct {
|
||||
Body optional.String
|
||||
Body optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (string, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue string
|
||||
localVarReturnValue string
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -391,7 +391,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -399,18 +399,18 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v string
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -426,7 +426,7 @@ For this test, the body for this request much reference a schema named `Fil
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaTestClass FileSchemaTestClass) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -477,7 +477,7 @@ func (a *FakeApiService) TestBodyWithFileSchema(ctx context.Context, fileSchemaT
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -494,7 +494,7 @@ FakeApiService
|
||||
*/
|
||||
func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query string, user User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -546,7 +546,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -564,12 +564,12 @@ To test \"client\" model
|
||||
*/
|
||||
func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Client, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Client
|
||||
localVarReturnValue Client
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -616,7 +616,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -624,18 +624,18 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Client
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -644,8 +644,8 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl
|
||||
}
|
||||
|
||||
/*
|
||||
FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param number None
|
||||
* @param double None
|
||||
@@ -665,21 +665,21 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン
|
||||
*/
|
||||
|
||||
type TestEndpointParametersOpts struct {
|
||||
Integer optional.Int32
|
||||
Int32_ optional.Int32
|
||||
Int64_ optional.Int64
|
||||
Float optional.Float32
|
||||
String_ optional.String
|
||||
Binary optional.Interface
|
||||
Date optional.String
|
||||
DateTime optional.Time
|
||||
Password optional.String
|
||||
Callback optional.String
|
||||
Integer optional.Int32
|
||||
Int32_ optional.Int32
|
||||
Int64_ optional.Int64
|
||||
Float optional.Float32
|
||||
String_ optional.String
|
||||
Binary optional.Interface
|
||||
Date optional.String
|
||||
DateTime optional.Time
|
||||
Password optional.String
|
||||
Callback optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -747,7 +747,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
localVarFileOk := false
|
||||
localVarFile, localVarFileOk = localVarOptionals.Binary.Value().(*os.File)
|
||||
if !localVarFileOk {
|
||||
return nil, reportError("binary should be *os.File")
|
||||
return nil, reportError("binary should be *os.File")
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
@@ -786,7 +786,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -811,19 +811,19 @@ To test enum parameters
|
||||
*/
|
||||
|
||||
type TestEnumParametersOpts struct {
|
||||
EnumHeaderStringArray optional.Interface
|
||||
EnumHeaderString optional.String
|
||||
EnumQueryStringArray optional.Interface
|
||||
EnumQueryString optional.String
|
||||
EnumQueryInteger optional.Int32
|
||||
EnumQueryDouble optional.Float64
|
||||
EnumFormStringArray optional.Interface
|
||||
EnumFormString optional.String
|
||||
EnumHeaderStringArray optional.Interface
|
||||
EnumHeaderString optional.String
|
||||
EnumQueryStringArray optional.Interface
|
||||
EnumQueryString optional.String
|
||||
EnumQueryInteger optional.Int32
|
||||
EnumQueryDouble optional.Float64
|
||||
EnumFormStringArray optional.Interface
|
||||
EnumFormString optional.String
|
||||
}
|
||||
|
||||
func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -896,7 +896,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -912,7 +912,7 @@ FakeApiService test inline additionalProperties
|
||||
*/
|
||||
func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -963,7 +963,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -980,7 +980,7 @@ FakeApiService test json serialization of form data
|
||||
*/
|
||||
func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, param2 string) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -1031,7 +1031,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
|
||||
@@ -33,12 +33,12 @@ To test class name in snake case
|
||||
*/
|
||||
func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, client Client) (Client, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarHttpMethod = strings.ToUpper("Patch")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Client
|
||||
localVarReturnValue Client
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -98,7 +98,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -106,18 +106,18 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Client
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -11,13 +11,13 @@ package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strings"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@@ -34,7 +34,7 @@ PetApiService Add a new pet to the store
|
||||
*/
|
||||
func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -85,7 +85,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -99,16 +99,16 @@ PetApiService Deletes a pet
|
||||
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
|
||||
* @param petId Pet id to delete
|
||||
* @param optional nil or *DeletePetOpts - Optional Parameters:
|
||||
* @param "ApiKey" (optional.String) -
|
||||
* @param "ApiKey" (optional.String) -
|
||||
*/
|
||||
|
||||
type DeletePetOpts struct {
|
||||
ApiKey optional.String
|
||||
ApiKey optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Delete")
|
||||
localVarHttpMethod = strings.ToUpper("Delete")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -161,7 +161,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -179,12 +179,12 @@ Multiple status values can be provided with comma separated strings
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ([]Pet, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue []Pet
|
||||
localVarReturnValue []Pet
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -230,7 +230,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -238,18 +238,18 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v []Pet
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -266,12 +266,12 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
|
||||
*/
|
||||
func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pet, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue []Pet
|
||||
localVarReturnValue []Pet
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -317,7 +317,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -325,18 +325,18 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v []Pet
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -353,12 +353,12 @@ Returns a single pet
|
||||
*/
|
||||
func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Pet
|
||||
localVarReturnValue Pet
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -417,7 +417,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -425,18 +425,18 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Pet
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -451,7 +451,7 @@ PetApiService Update an existing pet
|
||||
*/
|
||||
func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -502,7 +502,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response,
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -521,13 +521,13 @@ PetApiService Updates a pet in the store with form data
|
||||
*/
|
||||
|
||||
type UpdatePetWithFormOpts struct {
|
||||
Name optional.String
|
||||
Status optional.String
|
||||
Name optional.String
|
||||
Status optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -583,7 +583,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -603,18 +603,18 @@ PetApiService uploads an image
|
||||
*/
|
||||
|
||||
type UploadFileOpts struct {
|
||||
AdditionalMetadata optional.String
|
||||
File optional.Interface
|
||||
AdditionalMetadata optional.String
|
||||
File optional.Interface
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ApiResponse, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue ApiResponse
|
||||
localVarReturnValue ApiResponse
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -651,7 +651,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
localVarFileOk := false
|
||||
localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File)
|
||||
if !localVarFileOk {
|
||||
return localVarReturnValue, nil, reportError("file should be *os.File")
|
||||
return localVarReturnValue, nil, reportError("file should be *os.File")
|
||||
}
|
||||
}
|
||||
if localVarFile != nil {
|
||||
@@ -678,7 +678,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -686,18 +686,18 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v ApiResponse
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -716,17 +716,17 @@ PetApiService uploads an image (required)
|
||||
*/
|
||||
|
||||
type UploadFileWithRequiredFileOpts struct {
|
||||
AdditionalMetadata optional.String
|
||||
AdditionalMetadata optional.String
|
||||
}
|
||||
|
||||
func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId int64, requiredFile *os.File, localVarOptionals *UploadFileWithRequiredFileOpts) (ApiResponse, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue ApiResponse
|
||||
localVarReturnValue ApiResponse
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -783,7 +783,7 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -791,18 +791,18 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx context.Context, petId in
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v ApiResponse
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@@ -33,7 +33,7 @@ For valid response try integer IDs with value < 1000. Anything above 1000 or
|
||||
*/
|
||||
func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Delete")
|
||||
localVarHttpMethod = strings.ToUpper("Delete")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -83,7 +83,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -100,12 +100,12 @@ Returns a map of status codes to quantities
|
||||
*/
|
||||
func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue map[string]int32
|
||||
localVarReturnValue map[string]int32
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -163,7 +163,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -171,18 +171,18 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v map[string]int32
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -199,12 +199,12 @@ For valid response try integer IDs with value <= 5 or > 10. Other val
|
||||
*/
|
||||
func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Order, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Order
|
||||
localVarReturnValue Order
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -256,7 +256,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -264,18 +264,18 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Order
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -291,12 +291,12 @@ StoreApiService Place an order for a pet
|
||||
*/
|
||||
func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue Order
|
||||
localVarReturnValue Order
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -343,7 +343,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -351,18 +351,18 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v Order
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@@ -33,7 +33,7 @@ This can only be done by the logged in user.
|
||||
*/
|
||||
func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -84,7 +84,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -100,7 +100,7 @@ UserApiService Creates list of users with given input array
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -151,7 +151,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -167,7 +167,7 @@ UserApiService Creates list of users with given input array
|
||||
*/
|
||||
func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -218,7 +218,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -235,7 +235,7 @@ This can only be done by the logged in user.
|
||||
*/
|
||||
func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Delete")
|
||||
localVarHttpMethod = strings.ToUpper("Delete")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -285,7 +285,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -302,12 +302,12 @@ UserApiService Get user by user name
|
||||
*/
|
||||
func (a *UserApiService) GetUserByName(ctx context.Context, username string) (User, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue User
|
||||
localVarReturnValue User
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -353,7 +353,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -361,18 +361,18 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v User
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -389,12 +389,12 @@ UserApiService Logs user into the system
|
||||
*/
|
||||
func (a *UserApiService) LoginUser(ctx context.Context, username string, password string) (string, *http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
localVarFileBytes []byte
|
||||
localVarReturnValue string
|
||||
localVarReturnValue string
|
||||
)
|
||||
|
||||
// create path and map variables
|
||||
@@ -441,7 +441,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
|
||||
if localVarHttpResponse.StatusCode < 300 {
|
||||
// If we succeed, return the data, otherwise pass on to decode error.
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err == nil {
|
||||
return localVarReturnValue, localVarHttpResponse, err
|
||||
}
|
||||
@@ -449,18 +449,18 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
if localVarHttpResponse.StatusCode == 200 {
|
||||
var v string
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"))
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type"));
|
||||
if err != nil {
|
||||
newErr.error = err.Error()
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
newErr.model = v
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
return localVarReturnValue, localVarHttpResponse, newErr
|
||||
}
|
||||
@@ -474,7 +474,7 @@ UserApiService Logs out current logged in user session
|
||||
*/
|
||||
func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarHttpMethod = strings.ToUpper("Get")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -523,7 +523,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
@@ -541,7 +541,7 @@ This can only be done by the logged in user.
|
||||
*/
|
||||
func (a *UserApiService) UpdateUser(ctx context.Context, username string, user User) (*http.Response, error) {
|
||||
var (
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarHttpMethod = strings.ToUpper("Put")
|
||||
localVarPostBody interface{}
|
||||
localVarFormFileName string
|
||||
localVarFileName string
|
||||
@@ -593,7 +593,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, user U
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
return localVarHttpResponse, newErr
|
||||
|
||||
@@ -318,17 +318,17 @@ func (c *APIClient) prepareRequest(
|
||||
}
|
||||
|
||||
func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) {
|
||||
if strings.Contains(contentType, "application/xml") {
|
||||
if err = xml.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
if strings.Contains(contentType, "application/xml") {
|
||||
if err = xml.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
} else if strings.Contains(contentType, "application/json") {
|
||||
if err = json.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return nil
|
||||
} else if strings.Contains(contentType, "application/json") {
|
||||
if err = json.Unmarshal(b, v); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
return errors.New("undefined response type")
|
||||
}
|
||||
|
||||
@@ -480,4 +480,4 @@ func (e GenericOpenAPIError) Body() []byte {
|
||||
// Model returns the unpacked model of the error
|
||||
func (e GenericOpenAPIError) Model() interface{} {
|
||||
return e.model
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,6 @@ package petstore
|
||||
|
||||
// Model for testing model name starting with number
|
||||
type Model200Response struct {
|
||||
Name int32 `json:"name,omitempty"`
|
||||
Name int32 `json:"name,omitempty"`
|
||||
Class string `json:"class,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
package petstore
|
||||
|
||||
type AdditionalPropertiesClass struct {
|
||||
MapProperty map[string]string `json:"map_property,omitempty"`
|
||||
MapProperty map[string]string `json:"map_property,omitempty"`
|
||||
MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"`
|
||||
}
|
||||
|
||||
@@ -11,5 +11,5 @@ package petstore
|
||||
|
||||
type Animal struct {
|
||||
ClassName string `json:"className"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
package petstore
|
||||
|
||||
type ApiResponse struct {
|
||||
Code int32 `json:"code,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Code int32 `json:"code,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
package petstore
|
||||
|
||||
type ArrayTest struct {
|
||||
ArrayOfString []string `json:"array_of_string,omitempty"`
|
||||
ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"`
|
||||
ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"`
|
||||
ArrayOfString []string `json:"array_of_string,omitempty"`
|
||||
ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"`
|
||||
ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
package petstore
|
||||
|
||||
type Capitalization struct {
|
||||
SmallCamel string `json:"smallCamel,omitempty"`
|
||||
CapitalCamel string `json:"CapitalCamel,omitempty"`
|
||||
SmallSnake string `json:"small_Snake,omitempty"`
|
||||
CapitalSnake string `json:"Capital_Snake,omitempty"`
|
||||
SmallCamel string `json:"smallCamel,omitempty"`
|
||||
CapitalCamel string `json:"CapitalCamel,omitempty"`
|
||||
SmallSnake string `json:"small_Snake,omitempty"`
|
||||
CapitalSnake string `json:"Capital_Snake,omitempty"`
|
||||
SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"`
|
||||
// Name of the pet
|
||||
// Name of the pet
|
||||
ATT_NAME string `json:"ATT_NAME,omitempty"`
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ package petstore
|
||||
|
||||
type Cat struct {
|
||||
ClassName string `json:"className"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Declawed bool `json:"declawed,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Declawed bool `json:"declawed,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
package petstore
|
||||
|
||||
type Category struct {
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
@@ -11,6 +11,6 @@ package petstore
|
||||
|
||||
type Dog struct {
|
||||
ClassName string `json:"className"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Breed string `json:"breed,omitempty"`
|
||||
Color string `json:"color,omitempty"`
|
||||
Breed string `json:"breed,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
package petstore
|
||||
|
||||
type EnumArrays struct {
|
||||
JustSymbol string `json:"just_symbol,omitempty"`
|
||||
ArrayEnum []string `json:"array_enum,omitempty"`
|
||||
JustSymbol string `json:"just_symbol,omitempty"`
|
||||
ArrayEnum []string `json:"array_enum,omitempty"`
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type EnumClass string
|
||||
|
||||
// List of EnumClass
|
||||
@@ -16,4 +15,4 @@ const (
|
||||
ABC EnumClass = "_abc"
|
||||
EFG EnumClass = "-efg"
|
||||
XYZ EnumClass = "(xyz)"
|
||||
)
|
||||
)
|
||||
@@ -10,9 +10,9 @@
|
||||
package petstore
|
||||
|
||||
type EnumTest struct {
|
||||
EnumString string `json:"enum_string,omitempty"`
|
||||
EnumStringRequired string `json:"enum_string_required"`
|
||||
EnumInteger int32 `json:"enum_integer,omitempty"`
|
||||
EnumNumber float64 `json:"enum_number,omitempty"`
|
||||
OuterEnum OuterEnum `json:"outerEnum,omitempty"`
|
||||
EnumString string `json:"enum_string,omitempty"`
|
||||
EnumStringRequired string `json:"enum_string_required"`
|
||||
EnumInteger int32 `json:"enum_integer,omitempty"`
|
||||
EnumNumber float64 `json:"enum_number,omitempty"`
|
||||
OuterEnum OuterEnum `json:"outerEnum,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
package petstore
|
||||
|
||||
type FileSchemaTestClass struct {
|
||||
File File `json:"file,omitempty"`
|
||||
File File `json:"file,omitempty"`
|
||||
Files []File `json:"files,omitempty"`
|
||||
}
|
||||
|
||||
@@ -8,24 +8,23 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
type FormatTest struct {
|
||||
Integer int32 `json:"integer,omitempty"`
|
||||
Int32 int32 `json:"int32,omitempty"`
|
||||
Int64 int64 `json:"int64,omitempty"`
|
||||
Number float32 `json:"number"`
|
||||
Float float32 `json:"float,omitempty"`
|
||||
Double float64 `json:"double,omitempty"`
|
||||
String string `json:"string,omitempty"`
|
||||
Byte string `json:"byte"`
|
||||
Binary *os.File `json:"binary,omitempty"`
|
||||
Date string `json:"date"`
|
||||
Integer int32 `json:"integer,omitempty"`
|
||||
Int32 int32 `json:"int32,omitempty"`
|
||||
Int64 int64 `json:"int64,omitempty"`
|
||||
Number float32 `json:"number"`
|
||||
Float float32 `json:"float,omitempty"`
|
||||
Double float64 `json:"double,omitempty"`
|
||||
String string `json:"string,omitempty"`
|
||||
Byte string `json:"byte"`
|
||||
Binary *os.File `json:"binary,omitempty"`
|
||||
Date string `json:"date"`
|
||||
DateTime time.Time `json:"dateTime,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Password string `json:"password"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
package petstore
|
||||
|
||||
type MapTest struct {
|
||||
MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`
|
||||
MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`
|
||||
DirectMap map[string]bool `json:"direct_map,omitempty"`
|
||||
IndirectMap map[string]bool `json:"indirect_map,omitempty"`
|
||||
MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`
|
||||
MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`
|
||||
DirectMap map[string]bool `json:"direct_map,omitempty"`
|
||||
IndirectMap map[string]bool `json:"indirect_map,omitempty"`
|
||||
}
|
||||
|
||||
@@ -8,13 +8,12 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type MixedPropertiesAndAdditionalPropertiesClass struct {
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
DateTime time.Time `json:"dateTime,omitempty"`
|
||||
Map map[string]Animal `json:"map,omitempty"`
|
||||
Uuid string `json:"uuid,omitempty"`
|
||||
DateTime time.Time `json:"dateTime,omitempty"`
|
||||
Map map[string]Animal `json:"map,omitempty"`
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ package petstore
|
||||
|
||||
// Model for testing model name same as property name
|
||||
type Name struct {
|
||||
Name int32 `json:"name"`
|
||||
SnakeCase int32 `json:"snake_case,omitempty"`
|
||||
Property string `json:"property,omitempty"`
|
||||
Var123Number int32 `json:"123Number,omitempty"`
|
||||
Name int32 `json:"name"`
|
||||
SnakeCase int32 `json:"snake_case,omitempty"`
|
||||
Property string `json:"property,omitempty"`
|
||||
Var123Number int32 `json:"123Number,omitempty"`
|
||||
}
|
||||
|
||||
@@ -8,17 +8,16 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Order struct {
|
||||
Id int64 `json:"id,omitempty"`
|
||||
PetId int64 `json:"petId,omitempty"`
|
||||
Quantity int32 `json:"quantity,omitempty"`
|
||||
Id int64 `json:"id,omitempty"`
|
||||
PetId int64 `json:"petId,omitempty"`
|
||||
Quantity int32 `json:"quantity,omitempty"`
|
||||
ShipDate time.Time `json:"shipDate,omitempty"`
|
||||
// Order Status
|
||||
Status string `json:"status,omitempty"`
|
||||
Complete bool `json:"complete,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Complete bool `json:"complete,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
package petstore
|
||||
|
||||
type OuterComposite struct {
|
||||
MyNumber float32 `json:"my_number,omitempty"`
|
||||
MyString string `json:"my_string,omitempty"`
|
||||
MyBoolean bool `json:"my_boolean,omitempty"`
|
||||
MyNumber float32 `json:"my_number,omitempty"`
|
||||
MyString string `json:"my_string,omitempty"`
|
||||
MyBoolean bool `json:"my_boolean,omitempty"`
|
||||
}
|
||||
|
||||
@@ -8,12 +8,11 @@
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
type OuterEnum string
|
||||
|
||||
// List of OuterEnum
|
||||
const (
|
||||
PLACED OuterEnum = "placed"
|
||||
APPROVED OuterEnum = "approved"
|
||||
PLACED OuterEnum = "placed"
|
||||
APPROVED OuterEnum = "approved"
|
||||
DELIVERED OuterEnum = "delivered"
|
||||
)
|
||||
)
|
||||
@@ -10,11 +10,11 @@
|
||||
package petstore
|
||||
|
||||
type Pet struct {
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Category Category `json:"category,omitempty"`
|
||||
Name string `json:"name"`
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Category Category `json:"category,omitempty"`
|
||||
Name string `json:"name"`
|
||||
PhotoUrls []string `json:"photoUrls"`
|
||||
Tags []Tag `json:"tags,omitempty"`
|
||||
Tags []Tag `json:"tags,omitempty"`
|
||||
// pet status in the store
|
||||
Status string `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
package petstore
|
||||
|
||||
type Tag struct {
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
package petstore
|
||||
|
||||
type User struct {
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Username string `json:"username,omitempty"`
|
||||
Id int64 `json:"id,omitempty"`
|
||||
Username string `json:"username,omitempty"`
|
||||
FirstName string `json:"firstName,omitempty"`
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
LastName string `json:"lastName,omitempty"`
|
||||
Email string `json:"email,omitempty"`
|
||||
Password string `json:"password,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
// User Status
|
||||
UserStatus int32 `json:"userStatus,omitempty"`
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
3.2.3-SNAPSHOT
|
||||
3.3.0-SNAPSHOT
|
||||
@@ -11,6 +11,7 @@ package petstoreserver
|
||||
|
||||
// ApiResponse - Describes the result of uploading an image resource
|
||||
type ApiResponse struct {
|
||||
|
||||
Code int32 `json:"code,omitempty"`
|
||||
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
@@ -11,6 +11,7 @@ package petstoreserver
|
||||
|
||||
// Category - A category for a pet
|
||||
type Category struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
@@ -15,6 +15,7 @@ import (
|
||||
|
||||
// Order - An order for a pets from the pet store
|
||||
type Order struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
PetId int64 `json:"petId,omitempty"`
|
||||
|
||||
@@ -11,6 +11,7 @@ package petstoreserver
|
||||
|
||||
// Pet - A pet for sale in the pet store
|
||||
type Pet struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Category *Category `json:"category,omitempty"`
|
||||
|
||||
@@ -11,6 +11,7 @@ package petstoreserver
|
||||
|
||||
// Tag - A tag for a pet
|
||||
type Tag struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Name string `json:"name,omitempty"`
|
||||
|
||||
@@ -11,6 +11,7 @@ package petstoreserver
|
||||
|
||||
// User - A User who is purchasing from the pet store
|
||||
type User struct {
|
||||
|
||||
Id int64 `json:"id,omitempty"`
|
||||
|
||||
Username string `json:"username,omitempty"`
|
||||
|
||||
@@ -19,11 +19,11 @@ import (
|
||||
// Route is the information for every URI.
|
||||
type Route struct {
|
||||
// Name is the name of this Route.
|
||||
Name string
|
||||
Name string
|
||||
// Method is the string for the HTTP method. ex) GET, POST etc..
|
||||
Method string
|
||||
Method string
|
||||
// Pattern is the pattern of the URI.
|
||||
Pattern string
|
||||
Pattern string
|
||||
// HandlerFunc is the handler function of this route.
|
||||
HandlerFunc gin.HandlerFunc
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user