package conformist
Conformist allows you to define schemas to decode, validate and sanitize input data declaratively
Install
Dune Dependency
Authors
Maintainers
Sources
0.6.0.tar.gz
md5=462215fd0a1615b1f3686da1c80d2351
sha512=ad1cbe53293e4269d9be47edc5f3e1303b5707dd59715e29d0928b348661aab2d75977e88b4ec4841f2ec5931cd018d40b781911e503dcb5d3a5e3b0d3994aeb
doc/CHANGES.html
0.6.0 - 2021-05-30
Added
- Add
Conformist.list
to support decoding list of'a
Changed
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.
0.5.0 - 2021-04-12
Added
- Conformist type
datetime
that decodes toPtime.t
. This replacesdate
which has been deprecated.
0.4.0 - 2021-03-26
Changed
decode
,validate
anddecode_and_validate
all return the sameerror
type
Added
- Improve error reporting by printing provided input values (list of values)
0.3.0 - 2021-03-26
Changed
decode
returns a triple containing(field_name, input, error_msg)
instead of a concatenated string. This makes it easier to extract information.
Added
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.
0.2.1 - 2021-03-16
Changed
- Replace
ppx_deriving
withsexplib
[0.2.0] - 2021-03-07
Changed
- 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
.
[0.1.0] - 2020-09-29
Added
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
Fixed
- Move mandatory field name parameter to the end of create functions in order to get rid of the trailing () argument
[0.0.2] - 2020-09-29
Fixed
- Move
fold_left
to top level module and acceptConformist.t
as input
[0.0.1] - 2020-09-20
Added
- Initial release supporting
int
,float
,string
,bool
,Ptime.date
and custom types
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page