servant-multipart icon indicating copy to clipboard operation
servant-multipart copied to clipboard

Support API modifier

Open poscat0x04 opened this issue 5 years ago • 3 comments
trafficstars

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

poscat0x04 avatar Mar 31 '20 16:03 poscat0x04

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

alpmestan avatar Mar 31 '20 18:03 alpmestan

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

poscat0x04 avatar Apr 01 '20 04:04 poscat0x04

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.

alpmestan avatar Apr 01 '20 07:04 alpmestan