Git Product home page Git Product logo

ares's People

Contributors

bus-factor avatar codacy-badger avatar

Stargazers

 avatar

Watchers

 avatar

ares's Issues

As a user I want to make required fields nullable

As a user I want to make required fields nullable.

Acceptance Criteria:
If a field is required by validation schema, adding the validation rule nullable makes null a valid field value. By default values are not nullable.

As a user I want to validate a lists of similar data

As a user I want to validate a lists of similar data.

Acceptance Criteria:
A list of similar data is indicated by the additional data type list. This type also requires the user to define the input structure through a specific schema.
All list items in the input data are then validated against that schema and errors are added to the error list in case of validation errors.

Make 'type' option mandatory

Make 'type' option mandatory.

Acceptance Criteria:
If the validation schema is missing the 'type' option an Exception is thrown.

Validation by enum (IN) values

As a user I want to validate by enum values like this:

$schema = [ 'type' => 'string', 'string' => [ 'in' => ['sandbox', 'production'], ], ];

'in' => sandbox, production
The value must be included in the given list of values.

'not_in' => 'admin'
The value must not be included in the given list of values.

As a user I want to control if fields are required by default

As a user I want to control if fields are required by default.

Acceptance Criteria:
The user can provide the default behaviour of the validator regarding the required rule through the validation option allRequired. If allRequired is set true, all fields are required if not specified otherwise. If allRequired is set false, all fields are not required if not specified otherwise.

As a user I want to exclude specific values of a field to be valid

As a user I want to exclude specific values of a field to be valid.

This essentially is the opposite of the 'allowed' rule --> 'forbidden' rule.

Acceptance Criteria:
If a particular value is configured as being invalid ('forbidden' => ['forbidden-value']), the validation should result in an error if the value equals any of the defined forbidden values.

As a user I want to validate nested associative array structures

As a user I want to validate nested associative array structures.

Acceptance Criteria:
The validation schema supports the definition of validation rules for associative arrays.
The validation schema allows the definition of specific validation rules per field.
The solution supports nesting of associative arrays.

As a user I want to customize single validation messages

Idea:

// without custom message
$schema = [
    $ruleId => $ruleArgs,
];

// with custom message
$schema = [
    [
        $ruleId => $ruleArgs,
        'message' => 'My custom error message',
    ],
];

All rules have to be extended to support the additional options.

As a user I want to validate the exact length of strings

As a user I want to validate the exact length of strings.

Currently the exact length of strings can be validated using the minlength and maxlength validation rules with the identical value.

It should be possible to validate the exact length of strings with using only one validation rule.

Refactor builtin validation rules into separate classes

Refactor builtin validation rules into separate classes.

All implemented validation rules are currently implemented hard-coded, so there's no interface for adding new validator rules or making changes to the existing validation rules without making changes to the core validation logic.

Acceptance Criteria:
Each builtin validation rule resides in a separate class and all validation rules share a common interface. The common interface allows for extending the validation rule set with custom validations.

As a user I want to allow required string to be blank

As a user I want to allow required string to be blank.

Acceptance Criteria:
String values aren't allowed to be blank by default. However, the default behaviour can be changed by the user, so that strings values are valid if they're required and allowed to be blank.

As a user I want to validate the maximum length of strings

As a user I want to validate the maximum length of strings.

Acceptance Criteria:
When provided through the schema definition, the validation checks for maximum string length (applies to type=string only) and adds an error to the validation error list.

As a user I want to control if fields are nullable by default

As a user I want to control if fields are nullable by default.

Acceptance Criteria:
The user can provide the default behaviour of the validator regarding the nullable rule through the validation option allNullable. If allNullable is set true, all fields are nullable if not specified otherwise. If allNullable is set false, all fields are not nullable if not specified otherwise.

As a user I want to control if fields are blankable by default

As a user I want to control if fields are blankable by default.

Acceptance Criteria:
The user can provide the default behaviour of the validator regarding the blankable rule through the validation option allBlankable. If allBlankable is set true, all fields are blankable if not specified otherwise. If allBlankable is set false, all fields are not blankable if not specified otherwise.

As a user I want to validate the minimum length of strings

As a user I want to validation the minimum length of strings

Acceptance Criteria:
When provided through the validation schema, the validation checks for minimum string length (applies to type=string only) and adds an error to the validation error list.

Validate date values

As a user I want to validate date values.

  • custom format (Y-m-d | Y.m.d | Y.m) validation
  • date1 gt/lt/eq date2

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.