Do not check status code for default response (#3322)

* Do not check status code for default response

* Updated generated code/docs

Because Circle CI said

> Please run 'bin/utils/ensure-up-to-date' locally and commit
> changes (UNCOMMITTED CHANGES ERROR)
This commit is contained in:
Thiago Arrais 2019-10-14 14:29:46 -03:00 committed by William Cheng
parent 2cab048d41
commit cb2bf4d2bf
56 changed files with 377 additions and 219 deletions

View File

@ -2665,6 +2665,11 @@ public class DefaultCodegen implements CodegenConfig {
op.isResponseFile = Boolean.TRUE; op.isResponseFile = Boolean.TRUE;
} }
} }
op.responses.sort((a, b) -> {
int aDefault = "0".equals(a.code) ? 1 : 0;
int bDefault = "0".equals(b.code) ? 1 : 0;
return aDefault - bDefault;
});
op.responses.get(op.responses.size() - 1).hasMore = false; op.responses.get(op.responses.size() - 1).hasMore = false;
if (methodResponse != null) { if (methodResponse != null) {

View File

@ -319,7 +319,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
} }
{{#responses}} {{#responses}}
{{#dataType}} {{#dataType}}
{{^wildcard}}
if localVarHTTPResponse.StatusCode == {{{code}}} { if localVarHTTPResponse.StatusCode == {{{code}}} {
{{/wildcard}}
var v {{{dataType}}} var v {{{dataType}}}
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil { if err != nil {
@ -327,8 +329,13 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
{{#hasMore}}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
{{/hasMore}}
{{^wildcard}}
} }
{{/wildcard}}
{{/dataType}} {{/dataType}}
{{/responses}} {{/responses}}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr

View File

@ -317,7 +317,9 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
} }
{{#responses}} {{#responses}}
{{#dataType}} {{#dataType}}
{{^wildcard}}
if localVarHTTPResponse.StatusCode == {{{code}}} { if localVarHTTPResponse.StatusCode == {{{code}}} {
{{/wildcard}}
var v {{{dataType}}} var v {{{dataType}}}
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil { if err != nil {
@ -325,8 +327,12 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx _context.Context{{#hasParams
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
{{#hasMore}}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr
{{/hasMore}}
{{^wildcard}}
} }
{{/wildcard}}
{{/dataType}} {{/dataType}}
{{/responses}} {{/responses}}
return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHTTPResponse, newErr

View File

@ -595,6 +595,25 @@ public class DefaultCodegenTest {
Assert.assertEquals(co2.path, "/some/path"); Assert.assertEquals(co2.path, "/some/path");
} }
@Test
public void testDefaultResponseShouldBeLast() {
OpenAPI openAPI = TestUtils.createOpenAPI();
Operation myOperation = new Operation().operationId("myOperation").responses(
new ApiResponses()
.addApiResponse(
"default", new ApiResponse().description("Default"))
.addApiResponse(
"422", new ApiResponse().description("Error"))
);
openAPI.path("/here", new PathItem().get(myOperation));
final DefaultCodegen codegen = new DefaultCodegen();
codegen.setOpenAPI(openAPI);
CodegenOperation co = codegen.fromOperation("/here", "get", myOperation, null);
Assert.assertEquals(co.responses.get(0).message, "Error");
Assert.assertEquals(co.responses.get(1).message, "Default");
}
@Test @Test
public void testResponseWithNoSchemaInHeaders() { public void testResponseWithNoSchemaInHeaders() {
OpenAPI openAPI = TestUtils.createOpenAPI(); OpenAPI openAPI = TestUtils.createOpenAPI();

View File

@ -21,9 +21,9 @@ import Json.Encode as Encode
{-| Describes the result of uploading an image resource {-| Describes the result of uploading an image resource
-} -}
type alias ApiResponse = type alias ApiResponse =
{ code : Maybe Int { code : Maybe (Int)
, type_ : Maybe String , type_ : Maybe (String)
, message : Maybe String , message : Maybe (String)
} }
@ -35,15 +35,22 @@ decoder =
|> optional "message" (Decode.nullable Decode.string) Nothing |> optional "message" (Decode.nullable Decode.string) Nothing
encode : ApiResponse -> Encode.Value encode : ApiResponse -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) )
, ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) )
, ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) )
] ]
toString : ApiResponse -> String toString : ApiResponse -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -21,8 +21,8 @@ import Json.Encode as Encode
{-| A category for a pet {-| A category for a pet
-} -}
type alias Category = type alias Category =
{ id : Maybe Int { id : Maybe (Int)
, name : Maybe String , name : Maybe (String)
} }
@ -33,14 +33,21 @@ decoder =
|> optional "name" (Decode.nullable Decode.string) Nothing |> optional "name" (Decode.nullable Decode.string) Nothing
encode : Category -> Encode.Value encode : Category -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) )
, ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) )
] ]
toString : Category -> String toString : Category -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -22,12 +22,12 @@ import Json.Encode as Encode
{-| An order for a pets from the pet store {-| An order for a pets from the pet store
-} -}
type alias Order_ = type alias Order_ =
{ id : Maybe Int { id : Maybe (Int)
, petId : Maybe Int , petId : Maybe (Int)
, quantity : Maybe Int , quantity : Maybe (Int)
, shipDate : Maybe DateTime , shipDate : Maybe (DateTime)
, status : Maybe Status , status : Maybe (Status)
, complete : Maybe Bool , complete : Maybe (Bool)
} }
@ -37,6 +37,7 @@ type Status
| Delivered | Delivered
decoder : Decoder Order_ decoder : Decoder Order_
decoder = decoder =
decode Order_ decode Order_
@ -48,6 +49,7 @@ decoder =
|> optional "complete" (Decode.nullable Decode.bool) (Just False) |> optional "complete" (Decode.nullable Decode.bool) (Just False)
encode : Order_ -> Encode.Value encode : Order_ -> Encode.Value
encode model = encode model =
Encode.object Encode.object
@ -57,14 +59,18 @@ encode model =
, ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) )
, ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) )
, ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) )
] ]
toString : Order_ -> String toString : Order_ -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode
statusDecoder : Decoder Status statusDecoder : Decoder Status
statusDecoder = statusDecoder =
Decode.string Decode.string
@ -85,6 +91,7 @@ statusDecoder =
) )
encodeStatus : Status -> Encode.Value encodeStatus : Status -> Encode.Value
encodeStatus model = encodeStatus model =
case model of case model of
@ -96,3 +103,7 @@ encodeStatus model =
Delivered -> Delivered ->
Encode.string "delivered" Encode.string "delivered"

View File

@ -23,12 +23,12 @@ import Json.Encode as Encode
{-| A pet for sale in the pet store {-| A pet for sale in the pet store
-} -}
type alias Pet = type alias Pet =
{ id : Maybe Int { id : Maybe (Int)
, category : Maybe Category , category : Maybe (Category)
, name : String , name : String
, photoUrls : List String , photoUrls : (List String)
, tags : Maybe (List Tag) , tags : Maybe ((List Tag))
, status : Maybe Status , status : Maybe (Status)
} }
@ -38,6 +38,7 @@ type Status
| Sold | Sold
decoder : Decoder Pet decoder : Decoder Pet
decoder = decoder =
decode Pet decode Pet
@ -49,6 +50,7 @@ decoder =
|> optional "status" (Decode.nullable statusDecoder) Nothing |> optional "status" (Decode.nullable statusDecoder) Nothing
encode : Pet -> Encode.Value encode : Pet -> Encode.Value
encode model = encode model =
Encode.object Encode.object
@ -58,14 +60,18 @@ encode model =
, ( "photoUrls", (Encode.list << List.map Encode.string) model.photoUrls ) , ( "photoUrls", (Encode.list << List.map Encode.string) model.photoUrls )
, ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list << List.map Tag.encode) model.tags) ) , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list << List.map Tag.encode) model.tags) )
, ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) )
] ]
toString : Pet -> String toString : Pet -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode
statusDecoder : Decoder Status statusDecoder : Decoder Status
statusDecoder = statusDecoder =
Decode.string Decode.string
@ -86,6 +92,7 @@ statusDecoder =
) )
encodeStatus : Status -> Encode.Value encodeStatus : Status -> Encode.Value
encodeStatus model = encodeStatus model =
case model of case model of
@ -97,3 +104,7 @@ encodeStatus model =
Sold -> Sold ->
Encode.string "sold" Encode.string "sold"

View File

@ -21,8 +21,8 @@ import Json.Encode as Encode
{-| A tag for a pet {-| A tag for a pet
-} -}
type alias Tag = type alias Tag =
{ id : Maybe Int { id : Maybe (Int)
, name : Maybe String , name : Maybe (String)
} }
@ -33,14 +33,21 @@ decoder =
|> optional "name" (Decode.nullable Decode.string) Nothing |> optional "name" (Decode.nullable Decode.string) Nothing
encode : Tag -> Encode.Value encode : Tag -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) )
, ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) )
] ]
toString : Tag -> String toString : Tag -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -21,14 +21,14 @@ import Json.Encode as Encode
{-| A User who is purchasing from the pet store {-| A User who is purchasing from the pet store
-} -}
type alias User = type alias User =
{ id : Maybe Int { id : Maybe (Int)
, username : Maybe String , username : Maybe (String)
, firstName : Maybe String , firstName : Maybe (String)
, lastName : Maybe String , lastName : Maybe (String)
, email : Maybe String , email : Maybe (String)
, password : Maybe String , password : Maybe (String)
, phone : Maybe String , phone : Maybe (String)
, userStatus : Maybe Int , userStatus : Maybe (Int)
} }
@ -45,6 +45,7 @@ decoder =
|> optional "userStatus" (Decode.nullable Decode.int) Nothing |> optional "userStatus" (Decode.nullable Decode.int) Nothing
encode : User -> Encode.Value encode : User -> Encode.Value
encode model = encode model =
Encode.object Encode.object
@ -56,9 +57,15 @@ encode model =
, ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) )
, ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) )
, ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) )
] ]
toString : User -> String toString : User -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -34,4 +34,4 @@ decodeIsoString str =
toString : DateTime -> String toString : DateTime -> String
toString = toString =
toIsoString toIsoString

View File

@ -12,8 +12,8 @@
module Request.Pet exposing (addPet, deletePet, findPetsByStatus, findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile) module Request.Pet exposing (addPet, deletePet, findPetsByStatus, findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile)
import Data.ApiResponse as ApiResponse exposing (ApiResponse)
import Data.Pet as Pet exposing (Pet) import Data.Pet as Pet exposing (Pet)
import Data.ApiResponse as ApiResponse exposing (ApiResponse)
import Dict import Dict
import Http import Http
import Json.Decode as Decode import Json.Decode as Decode
@ -40,7 +40,7 @@ addPet model =
deletePet : Int -> Http.Request () deletePet : Int -> Http.Request ()
deletePet petId = deletePet petId =
{ method = "DELETE" { method = "DELETE"
, url = basePath ++ "/pet/" ++ toString petId , url = basePath ++ "/pet/" ++ toString petId
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectStringResponse (\_ -> Ok ()) , expect = Http.expectStringResponse (\_ -> Ok ())
@ -85,7 +85,7 @@ findPetsByTags =
getPetById : Int -> Http.Request Pet getPetById : Int -> Http.Request Pet
getPetById petId = getPetById petId =
{ method = "GET" { method = "GET"
, url = basePath ++ "/pet/" ++ toString petId , url = basePath ++ "/pet/" ++ toString petId
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson Pet.decoder , expect = Http.expectJson Pet.decoder
@ -111,7 +111,7 @@ updatePet model =
updatePetWithForm : Int -> Http.Request () updatePetWithForm : Int -> Http.Request ()
updatePetWithForm petId = updatePetWithForm petId =
{ method = "POST" { method = "POST"
, url = basePath ++ "/pet/" ++ toString petId , url = basePath ++ "/pet/" ++ toString petId
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectStringResponse (\_ -> Ok ()) , expect = Http.expectStringResponse (\_ -> Ok ())
@ -124,7 +124,7 @@ updatePetWithForm petId =
uploadFile : Int -> Http.Request ApiResponse uploadFile : Int -> Http.Request ApiResponse
uploadFile petId = uploadFile petId =
{ method = "POST" { method = "POST"
, url = basePath ++ "/pet/" ++ toString petId ++ "/uploadImage" , url = basePath ++ "/pet/" ++ toString petId ++ "/uploadImage"
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson ApiResponse.decoder , expect = Http.expectJson ApiResponse.decoder

View File

@ -28,7 +28,7 @@ basePath =
deleteOrder : String -> Http.Request () deleteOrder : String -> Http.Request ()
deleteOrder orderId = deleteOrder orderId =
{ method = "DELETE" { method = "DELETE"
, url = basePath ++ "/store/order/" ++ orderId , url = basePath ++ "/store/order/" ++ orderId
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectStringResponse (\_ -> Ok ()) , expect = Http.expectStringResponse (\_ -> Ok ())
@ -58,7 +58,7 @@ getInventory =
getOrderById : Int -> Http.Request Order_ getOrderById : Int -> Http.Request Order_
getOrderById orderId = getOrderById orderId =
{ method = "GET" { method = "GET"
, url = basePath ++ "/store/order/" ++ toString orderId , url = basePath ++ "/store/order/" ++ toString orderId
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson Order_.decoder , expect = Http.expectJson Order_.decoder

View File

@ -69,7 +69,7 @@ createUsersWithListInput model =
deleteUser : String -> Http.Request () deleteUser : String -> Http.Request ()
deleteUser username = deleteUser username =
{ method = "DELETE" { method = "DELETE"
, url = basePath ++ "/user/" ++ username , url = basePath ++ "/user/" ++ username
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectStringResponse (\_ -> Ok ()) , expect = Http.expectStringResponse (\_ -> Ok ())
@ -82,7 +82,7 @@ deleteUser username =
getUserByName : String -> Http.Request User getUserByName : String -> Http.Request User
getUserByName username = getUserByName username =
{ method = "GET" { method = "GET"
, url = basePath ++ "/user/" ++ username , url = basePath ++ "/user/" ++ username
, headers = [] , headers = []
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson User.decoder , expect = Http.expectJson User.decoder
@ -123,7 +123,7 @@ logoutUser =
updateUser : String -> User -> Http.Request () updateUser : String -> User -> Http.Request ()
updateUser username model = updateUser username model =
{ method = "PUT" { method = "PUT"
, url = basePath ++ "/user/" ++ username , url = basePath ++ "/user/" ++ username
, headers = [] , headers = []
, body = Http.jsonBody <| User.encode model , body = Http.jsonBody <| User.encode model
, expect = Http.expectStringResponse (\_ -> Ok ()) , expect = Http.expectStringResponse (\_ -> Ok ())

View File

@ -21,9 +21,9 @@ import Json.Encode as Encode
{-| Describes the result of uploading an image resource {-| Describes the result of uploading an image resource
-} -}
type alias ApiResponse = type alias ApiResponse =
{ code : Maybe Int { code : Maybe (Int)
, type_ : Maybe String , type_ : Maybe (String)
, message : Maybe String , message : Maybe (String)
} }
@ -35,15 +35,22 @@ decoder =
|> optional "message" (Decode.nullable Decode.string) Nothing |> optional "message" (Decode.nullable Decode.string) Nothing
encode : ApiResponse -> Encode.Value encode : ApiResponse -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) ) [ ( "code", Maybe.withDefault Encode.null (Maybe.map Encode.int model.code) )
, ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) ) , ( "type", Maybe.withDefault Encode.null (Maybe.map Encode.string model.type_) )
, ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) ) , ( "message", Maybe.withDefault Encode.null (Maybe.map Encode.string model.message) )
] ]
toString : ApiResponse -> String toString : ApiResponse -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -21,8 +21,8 @@ import Json.Encode as Encode
{-| A category for a pet {-| A category for a pet
-} -}
type alias Category = type alias Category =
{ id : Maybe Int { id : Maybe (Int)
, name : Maybe String , name : Maybe (String)
} }
@ -33,14 +33,21 @@ decoder =
|> optional "name" (Decode.nullable Decode.string) Nothing |> optional "name" (Decode.nullable Decode.string) Nothing
encode : Category -> Encode.Value encode : Category -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) )
, ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) )
] ]
toString : Category -> String toString : Category -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -22,12 +22,12 @@ import Json.Encode as Encode
{-| An order for a pets from the pet store {-| An order for a pets from the pet store
-} -}
type alias Order_ = type alias Order_ =
{ id : Maybe Int { id : Maybe (Int)
, petId : Maybe Int , petId : Maybe (Int)
, quantity : Maybe Int , quantity : Maybe (Int)
, shipDate : Maybe DateTime , shipDate : Maybe (DateTime)
, status : Maybe Status , status : Maybe (Status)
, complete : Maybe Bool , complete : Maybe (Bool)
} }
@ -37,6 +37,7 @@ type Status
| Delivered | Delivered
decoder : Decoder Order_ decoder : Decoder Order_
decoder = decoder =
Decode.succeed Order_ Decode.succeed Order_
@ -48,6 +49,7 @@ decoder =
|> optional "complete" (Decode.nullable Decode.bool) (Just False) |> optional "complete" (Decode.nullable Decode.bool) (Just False)
encode : Order_ -> Encode.Value encode : Order_ -> Encode.Value
encode model = encode model =
Encode.object Encode.object
@ -57,14 +59,18 @@ encode model =
, ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) ) , ( "shipDate", Maybe.withDefault Encode.null (Maybe.map DateTime.encode model.shipDate) )
, ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) )
, ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) ) , ( "complete", Maybe.withDefault Encode.null (Maybe.map Encode.bool model.complete) )
] ]
toString : Order_ -> String toString : Order_ -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode
statusDecoder : Decoder Status statusDecoder : Decoder Status
statusDecoder = statusDecoder =
Decode.string Decode.string
@ -85,6 +91,7 @@ statusDecoder =
) )
encodeStatus : Status -> Encode.Value encodeStatus : Status -> Encode.Value
encodeStatus model = encodeStatus model =
case model of case model of
@ -96,3 +103,7 @@ encodeStatus model =
Delivered -> Delivered ->
Encode.string "delivered" Encode.string "delivered"

View File

@ -23,12 +23,12 @@ import Json.Encode as Encode
{-| A pet for sale in the pet store {-| A pet for sale in the pet store
-} -}
type alias Pet = type alias Pet =
{ id : Maybe Int { id : Maybe (Int)
, category : Maybe Category , category : Maybe (Category)
, name : String , name : String
, photoUrls : List String , photoUrls : (List String)
, tags : Maybe (List Tag) , tags : Maybe ((List Tag))
, status : Maybe Status , status : Maybe (Status)
} }
@ -38,6 +38,7 @@ type Status
| Sold | Sold
decoder : Decoder Pet decoder : Decoder Pet
decoder = decoder =
Decode.succeed Pet Decode.succeed Pet
@ -49,23 +50,28 @@ decoder =
|> optional "status" (Decode.nullable statusDecoder) Nothing |> optional "status" (Decode.nullable statusDecoder) Nothing
encode : Pet -> Encode.Value encode : Pet -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) )
, ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) ) , ( "category", Maybe.withDefault Encode.null (Maybe.map Category.encode model.category) )
, ( "name", Encode.string model.name ) , ( "name", Encode.string model.name )
, ( "photoUrls", Encode.list Encode.string model.photoUrls ) , ( "photoUrls", (Encode.list Encode.string) model.photoUrls )
, ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) ) , ( "tags", Maybe.withDefault Encode.null (Maybe.map (Encode.list Tag.encode) model.tags) )
, ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) ) , ( "status", Maybe.withDefault Encode.null (Maybe.map encodeStatus model.status) )
] ]
toString : Pet -> String toString : Pet -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode
statusDecoder : Decoder Status statusDecoder : Decoder Status
statusDecoder = statusDecoder =
Decode.string Decode.string
@ -86,6 +92,7 @@ statusDecoder =
) )
encodeStatus : Status -> Encode.Value encodeStatus : Status -> Encode.Value
encodeStatus model = encodeStatus model =
case model of case model of
@ -97,3 +104,7 @@ encodeStatus model =
Sold -> Sold ->
Encode.string "sold" Encode.string "sold"

View File

@ -21,8 +21,8 @@ import Json.Encode as Encode
{-| A tag for a pet {-| A tag for a pet
-} -}
type alias Tag = type alias Tag =
{ id : Maybe Int { id : Maybe (Int)
, name : Maybe String , name : Maybe (String)
} }
@ -33,14 +33,21 @@ decoder =
|> optional "name" (Decode.nullable Decode.string) Nothing |> optional "name" (Decode.nullable Decode.string) Nothing
encode : Tag -> Encode.Value encode : Tag -> Encode.Value
encode model = encode model =
Encode.object Encode.object
[ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) ) [ ( "id", Maybe.withDefault Encode.null (Maybe.map Encode.int model.id) )
, ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) ) , ( "name", Maybe.withDefault Encode.null (Maybe.map Encode.string model.name) )
] ]
toString : Tag -> String toString : Tag -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -21,14 +21,14 @@ import Json.Encode as Encode
{-| A User who is purchasing from the pet store {-| A User who is purchasing from the pet store
-} -}
type alias User = type alias User =
{ id : Maybe Int { id : Maybe (Int)
, username : Maybe String , username : Maybe (String)
, firstName : Maybe String , firstName : Maybe (String)
, lastName : Maybe String , lastName : Maybe (String)
, email : Maybe String , email : Maybe (String)
, password : Maybe String , password : Maybe (String)
, phone : Maybe String , phone : Maybe (String)
, userStatus : Maybe Int , userStatus : Maybe (Int)
} }
@ -45,6 +45,7 @@ decoder =
|> optional "userStatus" (Decode.nullable Decode.int) Nothing |> optional "userStatus" (Decode.nullable Decode.int) Nothing
encode : User -> Encode.Value encode : User -> Encode.Value
encode model = encode model =
Encode.object Encode.object
@ -56,9 +57,15 @@ encode model =
, ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) ) , ( "password", Maybe.withDefault Encode.null (Maybe.map Encode.string model.password) )
, ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) ) , ( "phone", Maybe.withDefault Encode.null (Maybe.map Encode.string model.phone) )
, ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) ) , ( "userStatus", Maybe.withDefault Encode.null (Maybe.map Encode.int model.userStatus) )
] ]
toString : User -> String toString : User -> String
toString = toString =
Encode.encode 0 << encode Encode.encode 0 << encode

View File

@ -34,4 +34,4 @@ decodeIsoString str =
toString : DateTime -> String toString : DateTime -> String
toString = toString =
Iso8601.fromTime Iso8601.fromTime

View File

@ -10,10 +10,10 @@
-} -}
module Request.Pet exposing (Status(..), addPet, deletePet, findPetsByStatus, findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile) module Request.Pet exposing (addPet, deletePet, findPetsByStatus, Status(..), findPetsByTags, getPetById, updatePet, updatePetWithForm, uploadFile)
import Data.ApiResponse as ApiResponse exposing (ApiResponse)
import Data.Pet as Pet exposing (Pet) import Data.Pet as Pet exposing (Pet)
import Data.ApiResponse as ApiResponse exposing (ApiResponse)
import Dict import Dict
import Http import Http
import Json.Decode as Decode import Json.Decode as Decode
@ -25,7 +25,6 @@ type Status
| Pending | Pending
| Sold | Sold
stringifyStatus : Status -> String stringifyStatus : Status -> String
stringifyStatus value = stringifyStatus value =
case value of case value of
@ -39,6 +38,9 @@ stringifyStatus value =
"sold" "sold"
basePath : String basePath : String
basePath = basePath =
"http://petstore.swagger.io/v2" "http://petstore.swagger.io/v2"
@ -46,17 +48,20 @@ basePath =
addPet : addPet :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, body : Pet , body : Pet
} }
-> Cmd msg -> Cmd msg
addPet params = addPet params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet"]
[ "pet" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| Pet.encode params.body , body = Http.jsonBody <| Pet.encode params.body
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -65,21 +70,23 @@ addPet params =
deletePet : deletePet :
{ apiKey : Maybe String { apiKey : Maybe (String)
} ->
{ onSend : Result Http.Error () -> msg
, petId : Int
} }
->
{ onSend : Result Http.Error () -> msg
, petId : Int
}
-> Cmd msg -> Cmd msg
deletePet headers params = deletePet headers params =
Http.request Http.request
{ method = "DELETE" { method = "DELETE"
, headers = List.filterMap identity [ Maybe.map (Http.header "api_key" << identity) headers.apiKey ] , headers = List.filterMap identity [Maybe.map (Http.header "api_key" << identity) headers.apiKey]
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet", String.fromInt params.petId]
[ "pet", String.fromInt params.petId ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -91,6 +98,10 @@ deletePet headers params =
-} -}
findPetsByStatus : findPetsByStatus :
{ onSend : Result Http.Error (List Pet) -> msg { onSend : Result Http.Error (List Pet) -> msg
, status : List Status , status : List Status
} }
-> Cmd msg -> Cmd msg
@ -98,10 +109,9 @@ findPetsByStatus params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet", "findByStatus"]
[ "pet", "findByStatus" ] (List.filterMap identity [(Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status])
(List.filterMap identity [ (Just << Url.string "status" << String.join "," << List.map stringifyStatus) params.status ])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , expect = Http.expectJson params.onSend (Decode.list Pet.decoder)
, timeout = Just 30000 , timeout = Just 30000
@ -113,6 +123,10 @@ findPetsByStatus params =
-} -}
findPetsByTags : findPetsByTags :
{ onSend : Result Http.Error (List Pet) -> msg { onSend : Result Http.Error (List Pet) -> msg
, tags : List String , tags : List String
} }
-> Cmd msg -> Cmd msg
@ -120,10 +134,9 @@ findPetsByTags params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet", "findByTags"]
[ "pet", "findByTags" ] (List.filterMap identity [(Just << Url.string "tags" << String.join "," << List.map identity) params.tags])
(List.filterMap identity [ (Just << Url.string "tags" << String.join "," << List.map identity) params.tags ])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend (Decode.list Pet.decoder) , expect = Http.expectJson params.onSend (Decode.list Pet.decoder)
, timeout = Just 30000 , timeout = Just 30000
@ -135,17 +148,20 @@ findPetsByTags params =
-} -}
getPetById : getPetById :
{ onSend : Result Http.Error Pet -> msg { onSend : Result Http.Error Pet -> msg
, petId : Int , petId : Int
} }
-> Cmd msg -> Cmd msg
getPetById params = getPetById params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet", String.fromInt params.petId]
[ "pet", String.fromInt params.petId ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend Pet.decoder , expect = Http.expectJson params.onSend Pet.decoder
, timeout = Just 30000 , timeout = Just 30000
@ -155,17 +171,20 @@ getPetById params =
updatePet : updatePet :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, body : Pet , body : Pet
} }
-> Cmd msg -> Cmd msg
updatePet params = updatePet params =
Http.request Http.request
{ method = "PUT" { method = "PUT"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet"]
[ "pet" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| Pet.encode params.body , body = Http.jsonBody <| Pet.encode params.body
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -175,17 +194,20 @@ updatePet params =
updatePetWithForm : updatePetWithForm :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, petId : Int , petId : Int
} }
-> Cmd msg -> Cmd msg
updatePetWithForm params = updatePetWithForm params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet", String.fromInt params.petId]
[ "pet", String.fromInt params.petId ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -195,17 +217,20 @@ updatePetWithForm params =
uploadFile : uploadFile :
{ onSend : Result Http.Error ApiResponse -> msg { onSend : Result Http.Error ApiResponse -> msg
, petId : Int , petId : Int
} }
-> Cmd msg -> Cmd msg
uploadFile params = uploadFile params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["pet", String.fromInt params.petId, "uploadImage"]
[ "pet", String.fromInt params.petId, "uploadImage" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend ApiResponse.decoder , expect = Http.expectJson params.onSend ApiResponse.decoder
, timeout = Just 30000 , timeout = Just 30000

View File

@ -19,6 +19,8 @@ import Json.Decode as Decode
import Url.Builder as Url import Url.Builder as Url
basePath : String basePath : String
basePath = basePath =
"http://petstore.swagger.io/v2" "http://petstore.swagger.io/v2"
@ -28,17 +30,20 @@ basePath =
-} -}
deleteOrder : deleteOrder :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, orderId : String , orderId : String
} }
-> Cmd msg -> Cmd msg
deleteOrder params = deleteOrder params =
Http.request Http.request
{ method = "DELETE" { method = "DELETE"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["store", "order", identity params.orderId]
[ "store", "order", identity params.orderId ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -50,16 +55,20 @@ deleteOrder params =
-} -}
getInventory : getInventory :
{ onSend : Result Http.Error (Dict.Dict String Int) -> msg { onSend : Result Http.Error (Dict.Dict String Int) -> msg
} }
-> Cmd msg -> Cmd msg
getInventory params = getInventory params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["store", "inventory"]
[ "store", "inventory" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend (Decode.dict Decode.int) , expect = Http.expectJson params.onSend (Decode.dict Decode.int)
, timeout = Just 30000 , timeout = Just 30000
@ -71,17 +80,20 @@ getInventory params =
-} -}
getOrderById : getOrderById :
{ onSend : Result Http.Error Order_ -> msg { onSend : Result Http.Error Order_ -> msg
, orderId : Int , orderId : Int
} }
-> Cmd msg -> Cmd msg
getOrderById params = getOrderById params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["store", "order", String.fromInt params.orderId]
[ "store", "order", String.fromInt params.orderId ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend Order_.decoder , expect = Http.expectJson params.onSend Order_.decoder
, timeout = Just 30000 , timeout = Just 30000
@ -91,17 +103,20 @@ getOrderById params =
placeOrder : placeOrder :
{ onSend : Result Http.Error Order_ -> msg { onSend : Result Http.Error Order_ -> msg
, body : Order_ , body : Order_
} }
-> Cmd msg -> Cmd msg
placeOrder params = placeOrder params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["store", "order"]
[ "store", "order" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| Order_.encode params.body , body = Http.jsonBody <| Order_.encode params.body
, expect = Http.expectJson params.onSend Order_.decoder , expect = Http.expectJson params.onSend Order_.decoder
, timeout = Just 30000 , timeout = Just 30000

View File

@ -19,6 +19,8 @@ import Json.Decode as Decode
import Url.Builder as Url import Url.Builder as Url
basePath : String basePath : String
basePath = basePath =
"http://petstore.swagger.io/v2" "http://petstore.swagger.io/v2"
@ -28,17 +30,20 @@ basePath =
-} -}
createUser : createUser :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, body : User , body : User
} }
-> Cmd msg -> Cmd msg
createUser params = createUser params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user"]
[ "user" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| User.encode params.body , body = Http.jsonBody <| User.encode params.body
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -48,17 +53,20 @@ createUser params =
createUsersWithArrayInput : createUsersWithArrayInput :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, body : User , body : User
} }
-> Cmd msg -> Cmd msg
createUsersWithArrayInput params = createUsersWithArrayInput params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", "createWithArray"]
[ "user", "createWithArray" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| User.encode params.body , body = Http.jsonBody <| User.encode params.body
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -68,17 +76,20 @@ createUsersWithArrayInput params =
createUsersWithListInput : createUsersWithListInput :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, body : User , body : User
} }
-> Cmd msg -> Cmd msg
createUsersWithListInput params = createUsersWithListInput params =
Http.request Http.request
{ method = "POST" { method = "POST"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", "createWithList"]
[ "user", "createWithList" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| User.encode params.body , body = Http.jsonBody <| User.encode params.body
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -90,17 +101,20 @@ createUsersWithListInput params =
-} -}
deleteUser : deleteUser :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, username : String , username : String
} }
-> Cmd msg -> Cmd msg
deleteUser params = deleteUser params =
Http.request Http.request
{ method = "DELETE" { method = "DELETE"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", identity params.username]
[ "user", identity params.username ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -110,17 +124,20 @@ deleteUser params =
getUserByName : getUserByName :
{ onSend : Result Http.Error User -> msg { onSend : Result Http.Error User -> msg
, username : String , username : String
} }
-> Cmd msg -> Cmd msg
getUserByName params = getUserByName params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", identity params.username]
[ "user", identity params.username ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend User.decoder , expect = Http.expectJson params.onSend User.decoder
, timeout = Just 30000 , timeout = Just 30000
@ -130,18 +147,20 @@ getUserByName params =
loginUser : loginUser :
{ onSend : Result Http.Error String -> msg { onSend : Result Http.Error String -> msg
, username : String
, password : String
, username : String , password : String
} }
-> Cmd msg -> Cmd msg
loginUser params = loginUser params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", "login"]
[ "user", "login" ] (List.filterMap identity [(Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password])
(List.filterMap identity [ (Just << Url.string "username" << identity) params.username, (Just << Url.string "password" << identity) params.password ])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectJson params.onSend Decode.string , expect = Http.expectJson params.onSend Decode.string
, timeout = Just 30000 , timeout = Just 30000
@ -151,16 +170,20 @@ loginUser params =
logoutUser : logoutUser :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
} }
-> Cmd msg -> Cmd msg
logoutUser params = logoutUser params =
Http.request Http.request
{ method = "GET" { method = "GET"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", "logout"]
[ "user", "logout" ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.emptyBody , body = Http.emptyBody
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000
@ -172,18 +195,20 @@ logoutUser params =
-} -}
updateUser : updateUser :
{ onSend : Result Http.Error () -> msg { onSend : Result Http.Error () -> msg
, body : User , body : User
, username : String , username : String
} }
-> Cmd msg -> Cmd msg
updateUser params = updateUser params =
Http.request Http.request
{ method = "PUT" { method = "PUT"
, headers = List.filterMap identity [] , headers = List.filterMap identity []
, url = , url = Url.crossOrigin basePath
Url.crossOrigin basePath ["user", identity params.username]
[ "user", identity params.username ] (List.filterMap identity [])
(List.filterMap identity [])
, body = Http.jsonBody <| User.encode params.body , body = Http.jsonBody <| User.encode params.body
, expect = Http.expectWhatever params.onSend , expect = Http.expectWhatever params.onSend
, timeout = Just 30000 , timeout = Just 30000

View File

@ -96,7 +96,6 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, bod
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -176,7 +176,6 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -278,7 +277,6 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -376,7 +374,6 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -474,7 +471,6 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -700,7 +696,6 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -110,7 +110,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, bod
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -243,6 +243,7 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string)
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -331,6 +332,7 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -433,6 +435,7 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -694,7 +697,6 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -800,7 +802,6 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -176,7 +176,6 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -271,6 +270,7 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -359,6 +359,7 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context, body Order) (Order, *
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -366,6 +366,7 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -455,6 +456,7 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -97,7 +97,6 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, bod
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -177,7 +177,6 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -279,7 +278,6 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -377,7 +375,6 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -475,7 +472,6 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -701,7 +697,6 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -109,7 +109,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, bod
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -693,7 +693,6 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -799,7 +798,6 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -175,7 +175,6 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -96,7 +96,6 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, bod
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -176,7 +176,6 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -278,7 +277,6 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -376,7 +374,6 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -474,7 +471,6 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -700,7 +696,6 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, body Client) (Cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -108,7 +108,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, bod
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -692,7 +692,6 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -798,7 +797,6 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -174,7 +174,6 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -96,7 +96,6 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -84,7 +84,6 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault,
body: localVarBody, body: localVarBody,
error: localVarHTTPResponse.Status, error: localVarHTTPResponse.Status,
} }
if localVarHTTPResponse.StatusCode == 0 {
var v InlineResponseDefault var v InlineResponseDefault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil { if err != nil {
@ -92,8 +91,6 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -95,7 +95,6 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -193,7 +192,6 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -295,7 +293,6 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -393,7 +390,6 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -491,7 +487,6 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -717,7 +712,6 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (C
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -110,7 +110,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -243,6 +243,7 @@ func (a *PetApiService) FindPetsByStatus(ctx _context.Context, status []string)
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -331,6 +332,7 @@ func (a *PetApiService) FindPetsByTags(ctx _context.Context, tags []string) ([]P
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -433,6 +435,7 @@ func (a *PetApiService) GetPetById(ctx _context.Context, petId int64) (Pet, *_ne
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -694,7 +697,6 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -800,7 +802,6 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -176,7 +176,6 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -271,6 +270,7 @@ func (a *StoreApiService) GetOrderById(ctx _context.Context, orderId int64) (Ord
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -359,6 +359,7 @@ func (a *StoreApiService) PlaceOrder(ctx _context.Context, order Order) (Order,
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -366,6 +366,7 @@ func (a *UserApiService) GetUserByName(ctx _context.Context, username string) (U
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -455,6 +456,7 @@ func (a *UserApiService) LoginUser(ctx _context.Context, username string, passwo
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -4,8 +4,8 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Bar** | Pointer to **string** | | [optional] **Bar** | Pointer to **string** | | [optional] [readonly]
**Foo** | Pointer to **string** | | [optional] **Foo** | Pointer to **string** | | [optional] [readonly]
## Methods ## Methods

View File

@ -5,9 +5,9 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Name** | Pointer to **int32** | | **Name** | Pointer to **int32** | |
**SnakeCase** | Pointer to **int32** | | [optional] **SnakeCase** | Pointer to **int32** | | [optional] [readonly]
**Property** | Pointer to **string** | | [optional] **Property** | Pointer to **string** | | [optional]
**Var123Number** | Pointer to **int32** | | [optional] **Var123Number** | Pointer to **int32** | | [optional] [readonly]
## Methods ## Methods

View File

@ -4,7 +4,7 @@
Name | Type | Description | Notes Name | Type | Description | Notes
------------ | ------------- | ------------- | ------------- ------------ | ------------- | ------------- | -------------
**Bar** | Pointer to **string** | | [optional] **Bar** | Pointer to **string** | | [optional] [readonly]
**Baz** | Pointer to **string** | | [optional] **Baz** | Pointer to **string** | | [optional]
## Methods ## Methods

View File

@ -96,7 +96,6 @@ func (a *AnotherFakeApiService) Call123TestSpecialTags(ctx _context.Context, cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -84,7 +84,6 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault,
body: localVarBody, body: localVarBody,
error: localVarHTTPResponse.Status, error: localVarHTTPResponse.Status,
} }
if localVarHTTPResponse.StatusCode == 0 {
var v InlineResponseDefault var v InlineResponseDefault
err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil { if err != nil {
@ -92,8 +91,6 @@ func (a *DefaultApiService) FooGet(ctx _context.Context) (InlineResponseDefault,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
}
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -95,7 +95,6 @@ func (a *FakeApiService) FakeHealthGet(ctx _context.Context) (HealthCheckResult,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -193,7 +192,6 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx _context.Context, localVa
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -295,7 +293,6 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx _context.Context, local
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -393,7 +390,6 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -491,7 +487,6 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx _context.Context, localVar
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -717,7 +712,6 @@ func (a *FakeApiService) TestClientModel(ctx _context.Context, client Client) (C
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -108,7 +108,6 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx _context.Context, cli
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -692,7 +692,6 @@ func (a *PetApiService) UploadFile(ctx _context.Context, petId int64, localVarOp
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
@ -798,7 +797,6 @@ func (a *PetApiService) UploadFileWithRequiredFile(ctx _context.Context, petId i
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }

View File

@ -174,7 +174,6 @@ func (a *StoreApiService) GetInventory(ctx _context.Context) (map[string]int32,
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }
newErr.model = v newErr.model = v
return localVarReturnValue, localVarHTTPResponse, newErr
} }
return localVarReturnValue, localVarHTTPResponse, newErr return localVarReturnValue, localVarHTTPResponse, newErr
} }