Skip to content

Provide some standardized validators for common functionality #11

@BenjamenMeyer

Description

@BenjamenMeyer

Adding stoplight to another project, and it seems it would be good to do one of the following:

  1. Have stoplight provide some built-in validators
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions