Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/playerony/validator-js


https://github.com/playerony/validator-js

Last synced: 4 days ago
JSON representation

Awesome Lists containing this project

README

        

# validator-js

## Usage

Simple object validation using JSON schemas - another part of my project at University

###

## Example

```javascript
const data = {
name: "[email protected]",
objects: ["13.12.1995", "13.12.1995"]
};

const schema = {
parameters: {
name: {
type: "string",
format: "email"
},
objects: {
type: "array",
items: {
type: "string",
format: "date"
}
}
},
required: ["name", "objects"]
};

validate(data, schema);
```

###