haskell-servant / servant-multipart

Support for file uploads in multipart/form-data for servant
https://hackage.haskell.org/package/servant-multipart
40 stars 37 forks source link

Support API modifier #34

Open poscat0x04 opened 4 years ago

poscat0x04 commented 4 years ago

It would be nice if we can distinguish between optional and required arguments.

alpmestan commented 4 years ago

Are you talking about individual components of the "form" being optional/required, or the whole multipart request body?

poscat0x04 commented 4 years ago

Optional individual components, that is to distinguish optional/required/multiple at the type level, much like QueryParam' and QueryParams.

alpmestan commented 4 years ago

Ah... Hmm, well it's not entirely trivial to implement, you'd quite likely have to write your own variant on the multipart combinator from this package.

You can already have optional/required "fields" in the form, merely by using a Maybe for the optional fields, but the design of this package is such that you need to parse all the optional/required values in a single "aggregated" data type. Separating everything is a lot trickier I think.