strictyaml
strictyaml copied to clipboard
Feature request: support min/max range for Float/Int
Example usage:
>>>import strictyaml as sy
>>>schema = sy.Map({"foo": sy.Float(minimum=0, maximum=0.1)})
>>>sy.as_document({"foo": 0.2}, schema)
...
strictyaml.exceptions.YAMLSerializationError: when expecting a float in the range [0, 0.1], got 0.2
If there are no objections I could try creating a PR
No objections. Please just remember to write the story first and then make it pass. If you have any trouble setting up the test environment just let me know.
Is this going ok, @cxong ? Do you need any help?
Sorry for the delay; I briefly looked at it earlier but I haven't used hitch before and got stuck somewhere. I'll take a look again when I have time.