mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-10-14 08:23:45 +00:00
Update Go generators' default value (#362)
* udpate go client default value * update go generators' default value
This commit is contained in:
parent
3758aad225
commit
0dbb6dcaa6
@ -39,7 +39,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
|
||||
protected boolean withXml = false;
|
||||
|
||||
protected String packageName = "swagger";
|
||||
protected String packageName = "openapi";
|
||||
|
||||
public AbstractGoCodegen() {
|
||||
super();
|
||||
@ -111,7 +111,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
|
||||
cliOptions.clear();
|
||||
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)
|
||||
.defaultValue(Boolean.TRUE.toString()));
|
||||
|
@ -66,7 +66,7 @@ public class GoClientCodegen extends AbstractGoCodegen {
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
} else {
|
||||
setPackageName("swagger");
|
||||
setPackageName("openapi");
|
||||
}
|
||||
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_VERSION)) {
|
||||
|
@ -88,7 +88,7 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
||||
if (additionalProperties.containsKey(CodegenConstants.PACKAGE_NAME)) {
|
||||
setPackageName((String) additionalProperties.get(CodegenConstants.PACKAGE_NAME));
|
||||
} else {
|
||||
setPackageName("swagger");
|
||||
setPackageName("openapi");
|
||||
}
|
||||
|
||||
/*
|
||||
@ -150,8 +150,8 @@ public class GoServerCodegen extends AbstractGoCodegen {
|
||||
*/
|
||||
@Override
|
||||
public String getHelp() {
|
||||
return "Generates a Go server library using the swagger-tools project. By default, " +
|
||||
"it will also generate service classes--which you can disable with the `-Dnoservice` environment variable.";
|
||||
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.";
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,7 +274,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}
|
||||
|
||||
{{/returnType}}
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -445,24 +445,24 @@ func strlen(s string) int {
|
||||
return utf8.RuneCountInString(s)
|
||||
}
|
||||
|
||||
// GenericSwaggerError Provides access to the body, error and model on returned errors.
|
||||
type GenericSwaggerError struct {
|
||||
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
|
||||
type GenericOpenAPIError struct {
|
||||
body []byte
|
||||
error string
|
||||
model interface{}
|
||||
}
|
||||
|
||||
// Error returns non-empty string if there was an error.
|
||||
func (e GenericSwaggerError) Error() string {
|
||||
func (e GenericOpenAPIError) Error() string {
|
||||
return e.error
|
||||
}
|
||||
|
||||
// Body returns the raw bytes of the response
|
||||
func (e GenericSwaggerError) Body() []byte {
|
||||
func (e GenericOpenAPIError) Body() []byte {
|
||||
return e.body
|
||||
}
|
||||
|
||||
// Model returns the unpacked model of the error
|
||||
func (e GenericSwaggerError) Model() interface{} {
|
||||
func (e GenericOpenAPIError) Model() interface{} {
|
||||
return e.model
|
||||
}
|
@ -8,7 +8,7 @@ import (
|
||||
type APIResponse struct {
|
||||
*http.Response `json:"-"`
|
||||
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"`
|
||||
// RequestURL is the request URL. This value is always available, even if the
|
||||
// embedded *http.Response is nil.
|
||||
|
@ -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: \" \\
|
||||
|
||||
## 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
|
||||
- Package version: 1.0.0
|
||||
@ -163,5 +163,5 @@ r, err := client.Service.Operation(auth, args)
|
||||
|
||||
## Author
|
||||
|
||||
apiteam@swagger.io
|
||||
|
||||
|
||||
|
@ -1,34 +1,22 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: Swagger Petstore
|
||||
title: OpenAPI Petstore
|
||||
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:
|
||||
" \'
|
||||
termsOfService: http://swagger.io/terms/
|
||||
contact:
|
||||
email: apiteam@swagger.io
|
||||
license:
|
||||
name: Apache-2.0
|
||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
version: 1.0.0
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: http://swagger.io
|
||||
servers:
|
||||
- url: http://petstore.swagger.io:80/v2
|
||||
tags:
|
||||
- name: pet
|
||||
description: Everything about your Pets
|
||||
externalDocs:
|
||||
description: Find out more
|
||||
url: http://swagger.io
|
||||
- name: store
|
||||
description: Access to Petstore orders
|
||||
- name: user
|
||||
description: Operations about user
|
||||
externalDocs:
|
||||
description: Find out more about our store
|
||||
url: http://swagger.io
|
||||
paths:
|
||||
/pet:
|
||||
put:
|
||||
@ -1078,6 +1066,10 @@ components:
|
||||
type: string
|
||||
message:
|
||||
type: string
|
||||
example:
|
||||
code: 0
|
||||
type: type
|
||||
message: message
|
||||
Name:
|
||||
required:
|
||||
- name
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"context"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -92,7 +91,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, client Clie
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"context"
|
||||
"github.com/antihax/optional"
|
||||
"os"
|
||||
)
|
||||
@ -103,7 +102,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -203,7 +202,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -299,7 +298,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -395,7 +394,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -473,7 +472,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, query stri
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -550,7 +549,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, client Client) (Cl
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -710,7 +709,7 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -731,7 +730,7 @@ To test enum parameters
|
||||
* @param "EnumQueryString" (optional.String) - Query parameter enum test (string)
|
||||
* @param "EnumQueryInteger" (optional.Int32) - Query parameter enum test (double)
|
||||
* @param "EnumQueryDouble" (optional.Float64) - Query parameter enum test (double)
|
||||
* @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array)
|
||||
* @param "EnumFormStringArray" (optional.[]string) - Form parameter enum test (string array)
|
||||
* @param "EnumFormString" (optional.String) - Form parameter enum test (string)
|
||||
*/
|
||||
|
||||
@ -742,7 +741,7 @@ type TestEnumParametersOpts struct {
|
||||
EnumQueryString optional.String
|
||||
EnumQueryInteger optional.Int32
|
||||
EnumQueryDouble optional.Float64
|
||||
EnumFormStringArray optional.Interface
|
||||
EnumFormStringArray 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(), "")
|
||||
}
|
||||
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() {
|
||||
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 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
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 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 (
|
||||
localVarHttpMethod = strings.ToUpper("Post")
|
||||
localVarPostBody interface{}
|
||||
@ -885,7 +884,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, req
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -952,7 +951,7 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"context"
|
||||
)
|
||||
|
||||
// Linger please
|
||||
@ -106,7 +105,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, clie
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/antihax/optional"
|
||||
"os"
|
||||
@ -84,7 +83,7 @@ func (a *PetApiService) AddPet(ctx context.Context, pet Pet) (*http.Response, er
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -159,7 +158,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -235,7 +234,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) (
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -321,7 +320,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -421,7 +420,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -497,7 +496,7 @@ func (a *PetApiService) UpdatePet(ctx context.Context, pet Pet) (*http.Response,
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -577,7 +576,7 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -678,7 +677,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@ -82,7 +81,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -170,7 +169,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, *
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -262,7 +261,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -348,7 +347,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, order Order) (Order, *
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"context"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@ -83,7 +82,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, user User) (*http.Respo
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -149,7 +148,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, user []U
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -215,7 +214,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, user []Us
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -281,7 +280,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -356,7 +355,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -443,7 +442,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -516,7 +515,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error)
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
@ -585,7 +584,7 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, user U
|
||||
}
|
||||
|
||||
if localVarHttpResponse.StatusCode >= 300 {
|
||||
newErr := GenericSwaggerError{
|
||||
newErr := GenericOpenAPIError{
|
||||
body: localVarBody,
|
||||
error: localVarHttpResponse.Status,
|
||||
}
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/json"
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
@ -29,7 +29,6 @@ import (
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"context"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
@ -38,7 +37,7 @@ var (
|
||||
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.
|
||||
type APIClient struct {
|
||||
cfg *Configuration
|
||||
@ -457,24 +456,24 @@ func strlen(s string) int {
|
||||
return utf8.RuneCountInString(s)
|
||||
}
|
||||
|
||||
// GenericSwaggerError Provides access to the body, error and model on returned errors.
|
||||
type GenericSwaggerError struct {
|
||||
// GenericOpenAPIError Provides access to the body, error and model on returned errors.
|
||||
type GenericOpenAPIError struct {
|
||||
body []byte
|
||||
error string
|
||||
model interface{}
|
||||
}
|
||||
|
||||
// Error returns non-empty string if there was an error.
|
||||
func (e GenericSwaggerError) Error() string {
|
||||
func (e GenericOpenAPIError) Error() string {
|
||||
return e.error
|
||||
}
|
||||
|
||||
// Body returns the raw bytes of the response
|
||||
func (e GenericSwaggerError) Body() []byte {
|
||||
func (e GenericOpenAPIError) Body() []byte {
|
||||
return e.body
|
||||
}
|
||||
|
||||
// Model returns the unpacked model of the error
|
||||
func (e GenericSwaggerError) Model() interface{} {
|
||||
func (e GenericOpenAPIError) Model() interface{} {
|
||||
return e.model
|
||||
}
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
@ -63,7 +62,7 @@ func NewConfiguration() *Configuration {
|
||||
cfg := &Configuration{
|
||||
BasePath: "http://petstore.swagger.io:80/v2",
|
||||
DefaultHeader: make(map[string]string),
|
||||
UserAgent: "Swagger-Codegen/1.0.0/go",
|
||||
UserAgent: "OpenAPI-Generator/1.0.0/go",
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
|
@ -287,7 +287,7 @@ Name | Type | Description | Notes
|
||||
**enumQueryString** | **optional.String**| Query parameter enum test (string) | [default to -efg]
|
||||
**enumQueryInteger** | **optional.Int32**| Query parameter enum test (double) |
|
||||
**enumQueryDouble** | **optional.Float64**| Query parameter enum test (double) |
|
||||
**enumFormStringArray** | [**optional.Interface of []string**](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]
|
||||
|
||||
### Return type
|
||||
@ -314,7 +314,7 @@ test inline additionalProperties
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**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
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||
#
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
||||
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||
|
||||
git_user_id=$1
|
||||
git_repo_id=$2
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
|
@ -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: \" \\
|
||||
*
|
||||
* API version: 1.0.0
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstore
|
||||
@ -17,7 +16,7 @@ import (
|
||||
type APIResponse struct {
|
||||
*http.Response `json:"-"`
|
||||
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"`
|
||||
// RequestURL is the request URL. This value is always available, even if the
|
||||
// embedded *http.Response is nil.
|
||||
|
@ -1,34 +1,20 @@
|
||||
openapi: 3.0.1
|
||||
info:
|
||||
title: Swagger Petstore
|
||||
description: '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.'
|
||||
termsOfService: http://swagger.io/terms/
|
||||
contact:
|
||||
email: apiteam@swagger.io
|
||||
title: OpenAPI Petstore
|
||||
description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters.
|
||||
license:
|
||||
name: Apache-2.0
|
||||
url: http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
version: 1.0.0
|
||||
externalDocs:
|
||||
description: Find out more about Swagger
|
||||
url: http://swagger.io
|
||||
servers:
|
||||
- url: http://petstore.swagger.io/v2
|
||||
tags:
|
||||
- name: pet
|
||||
description: Everything about your Pets
|
||||
externalDocs:
|
||||
description: Find out more
|
||||
url: http://swagger.io
|
||||
- name: store
|
||||
description: Access to Petstore orders
|
||||
- name: user
|
||||
description: Operations about user
|
||||
externalDocs:
|
||||
description: Find out more about our store
|
||||
url: http://swagger.io
|
||||
paths:
|
||||
/pet:
|
||||
put:
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
@ -15,7 +14,7 @@ type ApiResponse struct {
|
||||
|
||||
Code int32 `json:"code,omitempty"`
|
||||
|
||||
Type_ string `json:"type,omitempty"`
|
||||
Type string `json:"type,omitempty"`
|
||||
|
||||
Message string `json:"message,omitempty"`
|
||||
}
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package petstoreserver
|
||||
|
@ -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
|
||||
* Contact: apiteam@swagger.io
|
||||
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
|
||||
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
|
||||
*/
|
||||
|
||||
package main
|
||||
|
Loading…
x
Reference in New Issue
Block a user