@@ -63,6 +63,7 @@ data ElmOptions = ElmOptions
6363 -- ^ Types that represent an empty Http response.
6464 , stringElmTypes :: [EType]
6565 -- ^ Types that represent a String.
66+ , expectJsonMethod :: Text
6667 }
6768
6869
@@ -101,6 +102,7 @@ defElmOptions = ElmOptions
101102 [ toElmType (Proxy :: Proxy String)
102103 , toElmType (Proxy :: Proxy T.Text)
103104 ]
105+ , expectJsonMethod = "Http.expectJson"
104106 }
105107
106108
@@ -505,7 +507,7 @@ mkRequest opts request =
505507 indent i "Err e -> toMsg (Err e)" <> line <+>
506508 indent i "Ok _ -> toMsg (Ok ()))"
507509 Just elmTypeExpr ->
508− "Http.expectJson toMsg" <+> renderDecoderName ((elmTypeAlterations opts) elmTypeExpr)
510+ stext (expectJsonMethod opts) <+> " toMsg" <+> renderDecoderName ((elmTypeAlterations opts) elmTypeExpr)
509511 Nothing -> error "mkHttpRequest: no reqReturnType?"
510512 -- case request ^. F.reqReturnType of
511513 -- Just elmTypeExpr | isEmptyType opts elmTypeExpr ->