Update Go generators' default value (#362)

* udpate go client default value

* update go generators' default value
This commit is contained in:
William Cheng 2018-05-08 10:16:38 +08:00 committed by GitHub
parent 3758aad225
commit 0dbb6dcaa6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
65 changed files with 197 additions and 273 deletions

View File

@ -39,7 +39,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
protected boolean withXml = false; protected boolean withXml = false;
protected String packageName = "swagger"; protected String packageName = "openapi";
public AbstractGoCodegen() { public AbstractGoCodegen() {
super(); super();
@ -111,7 +111,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
cliOptions.clear(); cliOptions.clear();
cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Go package name (convention: lowercase).") cliOptions.add(new CliOption(CodegenConstants.PACKAGE_NAME, "Go package name (convention: lowercase).")
.defaultValue("swagger")); .defaultValue("openapi"));
cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC) cliOptions.add(new CliOption(CodegenConstants.HIDE_GENERATION_TIMESTAMP, CodegenConstants.HIDE_GENERATION_TIMESTAMP_DESC)
.defaultValue(Boolean.TRUE.toString())); .defaultValue(Boolean.TRUE.toString()));

View File

@ -66,7 +66,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
} else { } else {
setPackageName("swagger"); setPackageName("openapi");
} }
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) { if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {

View File

@ -88,7 +88,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) { if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME)); setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
} else { } else {
setPackageName("swagger"); setPackageName("openapi");
} }
/* /*
@ -150,7 +150,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
*/ */
@Override @Override
public String getHelp() { public String getHelp() {
return "Generates a Go server library using the swagger-tools project. By default, " + return "Generates a Go server library using OpenAPI-Generator. By default, " +
"it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable."; "it will also generate service classes -- which you can disable with the `-Dnoservice` environment variable.";
} }

View File

@ -274,7 +274,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
{{/returnType}} {{/returnType}}
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -445,24 +445,24 @@ func strlen(s string) int {
return utf8.RuneCountInString(s) return utf8.RuneCountInString(s)
} }
// GenericSwaggerError Provides access to the body, error and model on returned errors. // GenericOpenAPIError Provides access to the body, error and model on returned errors.
type GenericSwaggerError struct { type GenericOpenAPIError struct {
body []byte body []byte
error string error string
model interface{} model interface{}
} }
// Error returns non-empty string if there was an error. // Error returns non-empty string if there was an error.
func (e GenericSwaggerError) Error() string { func (e GenericOpenAPIError) Error() string {
return e.error return e.error
} }
// Body returns the raw bytes of the response // Body returns the raw bytes of the response
func (e GenericSwaggerError) Body() []byte { func (e GenericOpenAPIError) Body() []byte {
return e.body return e.body
} }
// Model returns the unpacked model of the error // Model returns the unpacked model of the error
func (e GenericSwaggerError) Model() interface{} { func (e GenericOpenAPIError) Model() interface{} {
return e.model return e.model
} }

View File

@ -8,7 +8,7 @@ import (
type APIResponse struct { type APIResponse struct {
*http.Response `json:"-"` *http.Response `json:"-"`
Message string `json:"message,omitempty"` Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation. // Operation is the name of the OpenAPI operation.
Operation string `json:"operation,omitempty"` Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the // RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil. // embedded *http.Response is nil.

View File

@ -3,7 +3,7 @@
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
## Overview ## Overview
This API client was generated by the [openapi-generator](https://github.com/openapitools/openapi-generator) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client. This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [OpenAPI-spec](https://www.openapis.org/) from a remote server, you can easily generate an API client.
- API version: 1.0.0 - API version: 1.0.0
- Package version: 1.0.0 - Package version: 1.0.0
@ -163,5 +163,5 @@ r, err := client.Service.Operation(auth, args)
## Author ## Author
apiteam@swagger.io

View File

@ -1,34 +1,22 @@
openapi: 3.0.1 openapi: 3.0.1
info: info:
title: Swagger Petstore title: OpenAPI Petstore
description: 'This spec is mainly for testing Petstore server and contains fake description: 'This spec is mainly for testing Petstore server and contains fake
endpoints, models. Please do not use this for any other purpose. Special characters: endpoints, models. Please do not use this for any other purpose. Special characters:
" \' " \'
termsOfService: http://swagger.io/terms/
contact:
email: apiteam@swagger.io
license: license:
name: Apache-2.0 name: Apache-2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0 version: 1.0.0
externalDocs:
description: Find out more about Swagger
url: http://swagger.io
servers: servers:
- url: http://petstore.swagger.io:80/v2 - url: http://petstore.swagger.io:80/v2
tags: tags:
- name: pet - name: pet
description: Everything about your Pets description: Everything about your Pets
externalDocs:
description: Find out more
url: http://swagger.io
- name: store - name: store
description: Access to Petstore orders description: Access to Petstore orders
- name: user - name: user
description: Operations about user description: Operations about user
externalDocs:
description: Find out more about our store
url: http://swagger.io
paths: paths:
/pet: /pet:
put: put:
@ -1078,6 +1066,10 @@ components:
type: string type: string
message: message:
type: string type: string
example:
code: 0
type: type
message: message
Name: Name:
required: required:
- name - name

View File

@ -1,21 +1,20 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"context"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"context"
) )
// Linger please // Linger please
@ -92,7 +91,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Clie
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -1,21 +1,20 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"context"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"context"
"github.com/antihax/optional" "github.com/antihax/optional"
"os" "os"
) )
@ -103,7 +102,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -203,7 +202,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -299,7 +298,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -395,7 +394,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -473,7 +472,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -550,7 +549,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -710,7 +709,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -731,7 +730,7 @@ To test enum parameters
* @param "EnumQueryString" (optional.String) - Query parameter enum test (string) * @param "EnumQueryString" (optional.String) - Query parameter enum test (string)
* @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double) * @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double)
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double) * @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormStringArray" (optional.[]string) - Form parameter enum test (string array)
* @param "EnumFormString" (optional.String) - Form parameter enum test (string) * @param "EnumFormString" (optional.String) - Form parameter enum test (string)
*/ */
@ -742,7 +741,7 @@ type TestEnumParametersOpts struct {
EnumQueryString optional.String EnumQueryString optional.String
EnumQueryInteger optional.Int32 EnumQueryInteger optional.Int32
EnumQueryDouble optional.Float64 EnumQueryDouble optional.Float64
EnumFormStringArray optional.Interface EnumFormStringArray optional.[]string
EnumFormString optional.String EnumFormString optional.String
} }
@ -797,7 +796,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "") localVarHeaderParams["enum_header_string"] = parameterToString(localVarOptionals.EnumHeaderString.Value(), "")
} }
if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() { if localVarOptionals != nil && localVarOptionals.EnumFormStringArray.IsSet() {
localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "")) localVarFormParams.Add("enum_form_string_array", parameterToString(localVarOptionals.EnumFormStringArray.Value(), "csv"))
} }
if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() { if localVarOptionals != nil && localVarOptionals.EnumFormString.IsSet() {
localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), "")) localVarFormParams.Add("enum_form_string", parameterToString(localVarOptionals.EnumFormString.Value(), ""))
@ -819,7 +818,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -834,7 +833,7 @@ FakeApiService test inline additionalProperties
* @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background().
* @param requestBody request body * @param requestBody request body
*/ */
func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody string) (*http.Response, error) { func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, requestBody map[string]string) (*http.Response, error) {
var ( var (
localVarHttpMethod = strings.ToUpper("Post") localVarHttpMethod = strings.ToUpper("Post")
localVarPostBody interface{} localVarPostBody interface{}
@ -885,7 +884,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -952,7 +951,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -1,21 +1,20 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"context"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"context"
) )
// Linger please // Linger please
@ -106,7 +105,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -1,21 +1,20 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"context"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"context"
"fmt" "fmt"
"github.com/antihax/optional" "github.com/antihax/optional"
"os" "os"
@ -84,7 +83,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -159,7 +158,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -235,7 +234,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -321,7 +320,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -421,7 +420,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -497,7 +496,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response,
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -577,7 +576,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -678,7 +677,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -1,21 +1,20 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"context"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"context"
"fmt" "fmt"
) )
@ -82,7 +81,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -170,7 +169,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -262,7 +261,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -348,7 +347,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -1,21 +1,20 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"context"
"io/ioutil" "io/ioutil"
"net/http" "net/http"
"net/url" "net/url"
"strings" "strings"
"context"
"fmt" "fmt"
) )
@ -83,7 +82,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -149,7 +148,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -215,7 +214,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -281,7 +280,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -356,7 +355,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -443,7 +442,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -516,7 +515,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }
@ -585,7 +584,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, user U
} }
if localVarHttpResponse.StatusCode >= 300 { if localVarHttpResponse.StatusCode >= 300 {
newErr := GenericSwaggerError{ newErr := GenericOpenAPIError{
body: localVarBody, body: localVarBody,
error: localVarHttpResponse.Status, error: localVarHttpResponse.Status,
} }

View File

@ -1,17 +1,17 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
import ( import (
"bytes" "bytes"
"context"
"encoding/json" "encoding/json"
"encoding/xml" "encoding/xml"
"errors" "errors"
@ -29,7 +29,6 @@ import (
"time" "time"
"unicode/utf8" "unicode/utf8"
"context"
"golang.org/x/oauth2" "golang.org/x/oauth2"
) )
@ -38,7 +37,7 @@ var (
xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)")
) )
// APIClient manages communication with the Swagger Petstore API v1.0.0 // APIClient manages communication with the OpenAPI Petstore API v1.0.0
// In most cases there should be only one, shared, APIClient. // In most cases there should be only one, shared, APIClient.
type APIClient struct { type APIClient struct {
cfg *Configuration cfg *Configuration
@ -457,24 +456,24 @@ func strlen(s string) int {
return utf8.RuneCountInString(s) return utf8.RuneCountInString(s)
} }
// GenericSwaggerError Provides access to the body, error and model on returned errors. // GenericOpenAPIError Provides access to the body, error and model on returned errors.
type GenericSwaggerError struct { type GenericOpenAPIError struct {
body []byte body []byte
error string error string
model interface{} model interface{}
} }
// Error returns non-empty string if there was an error. // Error returns non-empty string if there was an error.
func (e GenericSwaggerError) Error() string { func (e GenericOpenAPIError) Error() string {
return e.error return e.error
} }
// Body returns the raw bytes of the response // Body returns the raw bytes of the response
func (e GenericSwaggerError) Body() []byte { func (e GenericOpenAPIError) Body() []byte {
return e.body return e.body
} }
// Model returns the unpacked model of the error // Model returns the unpacked model of the error
func (e GenericSwaggerError) Model() interface{} { func (e GenericOpenAPIError) Model() interface{} {
return e.model return e.model
} }

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
@ -63,7 +62,7 @@ func NewConfiguration() *Configuration {
cfg := &Configuration{ cfg := &Configuration{
BasePath: "http://petstore.swagger.io:80/v2", BasePath: "http://petstore.swagger.io:80/v2",
DefaultHeader: make(map[string]string), DefaultHeader: make(map[string]string),
UserAgent: "Swagger-Codegen/1.0.0/go", UserAgent: "OpenAPI-Generator/1.0.0/go",
} }
return cfg return cfg
} }

View File

@ -287,7 +287,7 @@ Name | Type | Description | Notes
**enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg] **enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg]
**enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) | **enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) |
**enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) | **enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) |
**enumFormStringArray** | [**optional.Interface of []string**](array.md)| Form parameter enum test (string array) | **enumFormStringArray** | **optional.[]string**| Form parameter enum test (string array) | [default to $]
**enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg] **enumFormString** | **optional.String**| Form parameter enum test (string) | [default to -efg]
### Return type ### Return type
@ -314,7 +314,7 @@ test inline additionalProperties
Name | Type | Description | Notes Name | Type | Description | Notes
------------- | ------------- | ------------- | ------------- ------------- | ------------- | ------------- | -------------
**ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
**requestBody** | [**string**](string.md)| request body | **requestBody** | [**map[string]string**](string.md)| request body |
### Return type ### Return type

View File

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ # ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
# #
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update" # Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
git_user_id=$1 git_user_id=$1
git_repo_id=$2 git_repo_id=$2

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstore package petstore
@ -17,7 +16,7 @@ import (
type APIResponse struct { type APIResponse struct {
*http.Response `json:"-"` *http.Response `json:"-"`
Message string `json:"message,omitempty"` Message string `json:"message,omitempty"`
// Operation is the name of the swagger operation. // Operation is the name of the OpenAPI operation.
Operation string `json:"operation,omitempty"` Operation string `json:"operation,omitempty"`
// RequestURL is the request URL. This value is always available, even if the // RequestURL is the request URL. This value is always available, even if the
// embedded *http.Response is nil. // embedded *http.Response is nil.

View File

@ -1,34 +1,20 @@
openapi: 3.0.1 openapi: 3.0.1
info: info:
title: Swagger Petstore title: OpenAPI Petstore
description: 'This is a sample server Petstore server. You can find out more about description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For
this sample, you can use the api key `special-key` to test the authorization filters.'
termsOfService: http://swagger.io/terms/
contact:
email: apiteam@swagger.io
license: license:
name: Apache-2.0 name: Apache-2.0
url: http://www.apache.org/licenses/LICENSE-2.0.html url: http://www.apache.org/licenses/LICENSE-2.0.html
version: 1.0.0 version: 1.0.0
externalDocs:
description: Find out more about Swagger
url: http://swagger.io
servers: servers:
- url: http://petstore.swagger.io/v2 - url: http://petstore.swagger.io/v2
tags: tags:
- name: pet - name: pet
description: Everything about your Pets description: Everything about your Pets
externalDocs:
description: Find out more
url: http://swagger.io
- name: store - name: store
description: Access to Petstore orders description: Access to Petstore orders
- name: user - name: user
description: Operations about user description: Operations about user
externalDocs:
description: Find out more about our store
url: http://swagger.io
paths: paths:
/pet: /pet:
put: put:

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver
@ -15,7 +14,7 @@ type ApiResponse struct {
Code int32 `json:"code,omitempty"` Code int32 `json:"code,omitempty"`
Type_ string `json:"type,omitempty"` Type string `json:"type,omitempty"`
Message string `json:"message,omitempty"` Message string `json:"message,omitempty"`
} }

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package petstoreserver package petstoreserver

View File

@ -1,11 +1,10 @@
/* /*
* Swagger Petstore * OpenAPI Petstore
* *
* This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
* *
* API version: 1.0.0 * API version: 1.0.0
* Contact: apiteam@swagger.io * Generated by: OpenAPI Generator (https://openapi-generator.tech)
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/ */
package main package main