I've been playing with this multipart crate and wanted to have "infinite" repetition support. Unfortunately the current design forces "fixed" repetition. Moreover the current repetition support has issues among which the need to repeat all the field acceptance criteria (e.g. content type).
In this issue I propose to modify the API to take an repetition: Repetition in field options where Repetition is defined like this:
enum Repetition {
Fixed(usize),
Infinite,
}
It shall default to Fixed(1) when calling MultipartFormDataField helpers.
More generally I don't think we need anything like an optional lower boundary and an optional upper boundary.
Another consideration: it may be a good idea to forbid duplicated fields to avoid the mess of computing an actual repetition value for a given field.
Hi,
I've been playing with this multipart crate and wanted to have "infinite" repetition support. Unfortunately the current design forces "fixed" repetition. Moreover the current repetition support has issues among which the need to repeat all the field acceptance criteria (e.g. content type).
In this issue I propose to modify the API to take an
repetition: Repetition
in field options whereRepetition
is defined like this:It shall default to
Fixed(1)
when callingMultipartFormDataField
helpers.More generally I don't think we need anything like an optional lower boundary and an optional upper boundary.
Another consideration: it may be a good idea to forbid duplicated fields to avoid the mess of computing an actual repetition value for a given field.
What do you think?
-- Arnaud