-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Labels
Description
Adding stoplight to another project, and it seems it would be good to do one of the following:
- Have stoplight provide some built-in validators
- Provide an add-on library (f.e
stoplight-rules) for some built-in validators
The primary purpose is to enable having some various pre-defined rules for well known types that people can just use instead of having to figure out how to do it. Some example types that should be covered as a starting point:
- int (signed, unsigned)
- floating point
- UUID
- boolean (string, numeric)
- generic string (perhaps with length specified?)
Some of these may require adding bounds (length, min/max, etc) as configuration/parameters to the provided rules.
NOTE: This is in comparison to other libraries like voluptuous which provide extensive Schema support; voluptuous relies on type-casting thus enabling the Python VM to be cracked via the isinstance and other type-casting methods.
painterjd