Download the PHP package rethink/json-validator without Composer

On this page you can find all versions of the php package rethink/json-validator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package json-validator

JSON Validator

A JSON Validator that designed to be elegant and easy to use.

Motivation

JSON Validation is a common task in automated API testing, JSON-Schema is complex and not easy to use, so i created this library to simplify the JSON validation process and made JSON validation more elegant and fun.

Features

Installation

You can install the latest version of JSON validator with the following command:

Documentation

Types

By default, JSON Validator shipped with seven kinds of built-in types:

Besides the built-in types, it is possible to define your custom type via defineType() method.

The following code snippets shows how we can define custom types through array or callable.

1. Define a composite type

This example defines a custom type named User, which have four properties. name and gender require be a string, age requires be an integer but allows to be nullable, and rating required to integer or boolean and allows to be null.

2. Define a list type

This defines UserCollection to be an array of User. In order to define a list type, the definition of the type much contains only one element.

3. Define a type in callable

It is also possible to define a type using a callable, which is useful to perform some validation on the data. Such as the example above defined a timestamp type, that requires the data to be a valid datetime.

Validate a Type

We can validate a type by the following two steps:

1. Create a Validator instance

2. Preform the validation

This example will check whether the given $data matches the type User, if validation fails, we can get the error messages through getErrors() method.

Strict Mode

In some situations, we may want an object matches our type strictly, we can utilizing strict mode to achieve this, the following is the example:

Related Projects


All versions of json-validator with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rethink/json-validator contains the following files

Loading the files please wait ....