mirror of
https://github.com/scarf-sh/tie.git
synced 2024-11-27 00:15:38 +03:00
Fix code generation for empty repsonse bodies
This commit is contained in:
parent
d13775ac83
commit
7c86d4a8cc
@ -71,7 +71,7 @@ codegenToResponses operationName responses defaultResponse =
|
||||
| Just {} <- jsonResponseContent =
|
||||
"(" <> "Data.Aeson.fromEncoding" <+> "(" <> "Data.Aeson.toEncoding" <+> "x" <> ")" <> ")"
|
||||
| otherwise =
|
||||
mempty
|
||||
"mempty"
|
||||
|
||||
responseHeaders Response {jsonResponseContent}
|
||||
| Just {} <- jsonResponseContent =
|
||||
|
@ -160,7 +160,7 @@ data CreatePetsResponse
|
||||
|
||||
instance ToResponse CreatePetsResponse where
|
||||
toResponse (CreatePetsResponse201 ) =
|
||||
Network.Wai.responseBuilder (toEnum 201) []
|
||||
Network.Wai.responseBuilder (toEnum 201) [] mempty
|
||||
toResponse (CreatePetsDefaultResponse status x) =
|
||||
Network.Wai.responseBuilder status [(Network.HTTP.Types.hContentType, "application/json")] (Data.Aeson.fromEncoding (Data.Aeson.toEncoding x))
|
||||
---------------------
|
||||
|
Loading…
Reference in New Issue
Block a user