@@ -90,7 +90,7 @@ elmEndpointDefinition urlBase moduleName endpoint =
90
90
| (_, type_, arg) <- _queryString $ _url endpoint
91
91
]
92
92
, [ _encodedType body
93
- | Just body <- [_body endpoint]
93
+ | Just (_, body) <- [_body endpoint]
94
94
]
95
95
]
96
96
)
@@ -286,9 +286,9 @@ elmEndpointDefinition urlBase moduleName endpoint =
286
286
Nothing ->
287
287
" Http.emptyBody"
288
288
289
- Just body ->
289
+ Just (bodyType, body) ->
290
290
Expression. App
291
- " Http.jsonBody "
291
+ (vacuous bodyType)
292
292
(Expression. App (vacuous $ _encoder body) $ pure bodyArgName)
293
293
294
294
elmExpect =
@@ -402,7 +402,7 @@ data Endpoint = Endpoint
402
402
{ _url :: URL
403
403
, _method :: HTTP. Method
404
404
, _headers :: [(Text , Encoder , Bool )]
405
- , _body :: Maybe Encoder
405
+ , _body :: Maybe ( Expression Void , Encoder )
406
406
, _returnType :: Maybe Decoder
407
407
, _functionName :: [Text ]
408
408
}
@@ -561,7 +561,7 @@ instance (HasElmEncoder Aeson.Value a, HasElmEndpoints api, list ~ '[Servant.JSO
561
561
=> HasElmEndpoints (Servant. ReqBody' mods list a :> api ) where
562
562
elmEndpoints' prefix =
563
563
elmEndpoints' @ api prefix
564
- { _body = Just $ makeEncoder @ Aeson. Value @ a
564
+ { _body = Just ( " Http.jsonBody " , makeEncoder @ Aeson. Value @ a )
565
565
}
566
566
567
567
instance (KnownSymbol path , HasElmEndpoints api ) => HasElmEndpoints (path :> api ) where
0 commit comments