- Run decoder only once
- Correctly handle optionals with no provided defaults
Make
functor to customize the error type and the error messages, which be default Englishstring
s
- Add
Conformist.list
to support decoding list of'a
Conformist.Field.optional
is nowConformist.Field.is_optional
to avoid confusion withConformist.optional
- The encoded value is assumed to be
string list
instead ofstring
. This is preparation to support decoding of a list of strings.
- Conformist type
datetime
that decodes toPtime.t
. This replacesdate
which has been deprecated.
decode
,validate
anddecode_and_validate
all return the sameerror
type
- Improve error reporting by printing provided input values (list of values)
decode
returns a triple containing(field_name, input, error_msg)
instead of a concatenated string. This makes it easier to extract information.
decode_and_validate
combinesdecode
andvalidate
where the returned value is either the decoded value or a list of errors. When usingdecode_and_validate
, one can forget about the difference betweendecode
andvalidate
and simply forward the list of errors. This covers a common use case.
- Replace
ppx_deriving
withsexplib
- A field that is
optional
can be missing from the input data or the value can be[]
. Decoding and validation will still work as expected. The decoded value isNone
.
Conformist.Field.type_
can be used to retrieve a string representation of the type- Support for custom
encoders
for custom types - Support for encoding default values if present, this can be used to print schemas
- Move mandatory field name parameter to the end of create functions in order to get rid of the trailing () argument
- Move
fold_left
to top level module and acceptConformist.t
as input
- Initial release supporting
int
,float
,string
,bool
,Ptime.date
and custom types