Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support shorthand definitions of validators #71

@WangLarry

Description

@WangLarry

Is your feature request related to a problem? Please describe.
Current validators of Jafar are defined by object, which is appropriate for designer and builder tools. But sometimes it is not for programmer.

Describe the solution you'd like
Shorthand definitions are necessary.

Describe alternatives you've considered
Moleculer has a validator, which support shorthand definitions.

const schema = {
    password: "string|min:6",
    age: "number|optional|integer|positive|min:0|max:99", // additional properties
    state: ["boolean", "number|min:0|max:1"] // multiple types
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions