strictyaml icon indicating copy to clipboard operation
strictyaml copied to clipboard

Feature request: support min/max range for Float/Int

Open cxong opened this issue 6 years ago • 3 comments

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

cxong avatar Oct 03 '19 04:10 cxong

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.

crdoconnor avatar Oct 03 '19 09:10 crdoconnor

Is this going ok, @cxong ? Do you need any help?

crdoconnor avatar Oct 05 '19 15:10 crdoconnor

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.

cxong avatar Oct 06 '19 12:10 cxong