Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/epoberezkin/fjv
Fake JSON-Schema validator
https://github.com/epoberezkin/fjv
fake json-schema validator
Last synced: 19 days ago
JSON representation
Fake JSON-Schema validator
- Host: GitHub
- URL: https://github.com/epoberezkin/fjv
- Owner: epoberezkin
- License: mit
- Created: 2017-03-04T13:33:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-03-04T17:05:51.000Z (over 7 years ago)
- Last Synced: 2024-10-07T16:57:44.594Z (29 days ago)
- Topics: fake, json-schema, validator
- Language: JavaScript
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fjv
Fake JSON-Schema validator[![Build Status](https://travis-ci.org/epoberezkin/fjv.svg?branch=master)](https://travis-ci.org/epoberezkin/fjv)
[![npm version](https://badge.fury.io/js/fjv.svg)](https://www.npmjs.com/package/fjv)## DO NOT USE IT!
It was created as an illustration that passing all tests from the "official" [JSON-Schema-Test-Suite](https://github.com/json-schema-org/JSON-Schema-Test-Suite) does not mean that the validator can be used - this one always returns `true` in all cases not covered by the tests.
Use [Ajv](https://github.com/epoberezkin/ajv) instead.
## Install
```
npm install fjv
```## Usage
The fastest validation call:
```javascript
var Fjv = require('fjv');
var fjv = new Fjv;
var validate = fjv.compile(schema);
var valid = validate(data);
if (!valid) console.log(validate.errors);
```or with less code
```javascript
// ...
var valid = fjv.validate(schema, data);
if (!valid) console.log(fjv.errors);
// ...
```## License
[MIT](https://github.com/epoberezkin/fjv/blob/master/LICENSE)