@@ -25,6 +25,7 @@ import qualified Data.Text as Text
25
25
import qualified Network.HTTP.Types as HTTP
26
26
import Servant.API ((:<|>) , (:>) )
27
27
import qualified Servant.API as Servant
28
+ import qualified Servant.Multipart as Servant
28
29
import qualified Servant.API.Modifiers as Servant
29
30
30
31
import Language.Elm.Definition (Definition )
@@ -564,6 +565,13 @@ instance (HasElmEncoder Aeson.Value a, HasElmEndpoints api, list ~ '[Servant.JSO
564
565
{ _body = Just (" Http.jsonBody" , makeEncoder @ Aeson. Value @ a )
565
566
}
566
567
568
+ instance (HasElmEncoder (Servant. MultipartData tag ) a , HasElmEndpoints api )
569
+ => HasElmEndpoints (Servant. MultipartForm tag a :> api ) where
570
+ elmEndpoints' prefix =
571
+ elmEndpoints' @ api prefix
572
+ { _body = Just (" Http.multipartBody" , makeEncoder @ (Servant. MultipartData tag ) @ a )
573
+ }
574
+
567
575
instance (KnownSymbol path , HasElmEndpoints api ) => HasElmEndpoints (path :> api ) where
568
576
elmEndpoints' prefix =
569
577
elmEndpoints' @ api prefix
@@ -607,3 +615,11 @@ instance HasElmType Servant.NoContent where
607
615
instance HasElmDecoder Aeson. Value Servant. NoContent where
608
616
elmDecoder =
609
617
Expression. App " Json.Decode.succeed" " NoContent.NoContent"
618
+
619
+ instance HasElmType (Servant. MultipartData tag ) where
620
+ elmType =
621
+ Type. App " List.List" " Http.Part"
622
+
623
+ instance HasElmEncoder (Servant. MultipartData tag ) (Servant. MultipartData tag ) where
624
+ elmEncoder =
625
+ " Basics.identity"
0 commit comments