Kangaroo

JSON Schema Validation Package for Java.

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

com.clivern
Идентификатор

Идентификатор

kangaroo
Последняя версия

Последняя версия

0.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Kangaroo
JSON Schema Validation Package for Java.
Ссылка на сайт

Ссылка на сайт

https://github.com/clivern/kangaroo
Система контроля версий

Система контроля версий

https://github.com/clivern/kangaroo

Скачать kangaroo

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.clivern/kangaroo/ -->
<dependency>
    <groupId>com.clivern</groupId>
    <artifactId>kangaroo</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.clivern/kangaroo/
implementation 'com.clivern:kangaroo:0.0.1'
// https://jarcasting.com/artifacts/com.clivern/kangaroo/
implementation ("com.clivern:kangaroo:0.0.1")
'com.clivern:kangaroo:jar:0.0.1'
<dependency org="com.clivern" name="kangaroo" rev="0.0.1">
  <artifact name="kangaroo" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.clivern', module='kangaroo', version='0.0.1')
)
libraryDependencies += "com.clivern" % "kangaroo" % "0.0.1"
[com.clivern/kangaroo "0.0.1"]

Зависимости

runtime (3)

Идентификатор библиотеки Тип Версия
com.google.guava : guava jar 27.1-jre
com.google.code.gson : gson jar 2.8.5
com.googlecode.json-simple : json-simple jar 1.1.1

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

Kangaroo Logo

Kangaroo

JSON Schema Validation Package for Java.

Kangaroo is a Java implementation for the JSON Schema Standard (draft-03, draft-04, draft-06 and draft-07), that will help you validate all sorts of JSON documents, whether they are configuration files or a set of data sent to a RESTful API endpoint.

Documentation

Installation

To add a dependency using Maven, use the following:

<dependency>
    <groupId>com.clivern</groupId>
    <artifactId>kangaroo</artifactId>
    <version>0.0.1</version>
</dependency>

To add a dependency using Gradle, use the following:

dependencies {
    compile 'com.clivern:kangaroo:0.0.1'
}

To add a dependency using Scala SBT, use the following:

libraryDependencies += "com.clivern" % "kangaroo" % "0.0.1"

Usage

First import & initialize all required classes.

import com.clivern.kangaroo.util.FileReader;
import com.clivern.kangaroo.SchemaFactory;
import com.clivern.kangaroo.Validator;


FileReader fileReader = new FileReader();
SchemaFactory schemaFactory = new SchemaFactory();
Validator validator = new Validator();

Then validate the JSON string against the JSON Schema.

import com.clivern.kangaroo.SchemaDraft3;


// For SchemaDraft3
SchemaDraft3 schemaDraft3 = schemaFactory.unserialize(
    fileReader.readFileAsString("path/to/endpoint/schema03_definition.json"),
    SchemaDraft3.class
);

validator.validate(schemaDraft3, "{...JSON_DATA_HERE...}");  // returns Boolean (true || false)
validator.hasErrors();                                       // returns Boolean (true || false)
validator.getErrors();                                       // returns ArrayList<String>
import com.clivern.kangaroo.SchemaDraft4;


// For SchemaDraft4
SchemaDraft4 schemaDraft4 = schemaFactory.unserialize(
    fileReader.readFileAsString("path/to/endpoint/schema04_definition.json"),
    SchemaDraft4.class
);

validator.validate(schemaDraft4, "{...JSON_DATA_HERE...}");  // returns Boolean (true || false)
validator.hasErrors();                                       // returns Boolean (true || false)
validator.getErrors();                                       // returns ArrayList<String>
import com.clivern.kangaroo.SchemaDraft6;


// For SchemaDraft6
SchemaDraft6 schemaDraft6 = schemaFactory.unserialize(
    fileReader.readFileAsString("path/to/endpoint/schema06_definition.json"),
    SchemaDraft6.class
);

validator.validate(schemaDraft6, "{...JSON_DATA_HERE...}");  // returns Boolean (true || false)
validator.hasErrors();                                       // returns Boolean (true || false)
validator.getErrors();                                       // returns ArrayList<String>
import com.clivern.kangaroo.SchemaDraft7;


// For SchemaDraft7
SchemaDraft7 schemaDraft7 = schemaFactory.unserialize(
    fileReader.readFileAsString("path/to/endpoint/schema07_definition.json"),
    SchemaDraft7.class
);

validator.validate(schemaDraft7, "{...JSON_DATA_HERE...}");  // returns Boolean (true || false)
validator.hasErrors();                                       // returns Boolean (true || false)
validator.getErrors();                                       // returns ArrayList<String>

Examples

#

Versioning

For transparency into our release cycle and in striving to maintain backward compatibility, Kangaroo is maintained under the Semantic Versioning guidelines and release process is predictable and business-friendly.

See the Releases section of our GitHub project for changelogs for each release version of Kangaroo. It contains summaries of the most noteworthy changes made in each release.

Bug tracker

If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at https://github.com/clivern/kangaroo/issues

Security Issues

If you discover a security vulnerability within Kangaroo, please send an email to hello@clivern.com

Contributing

We are an open source, community-driven project so please feel free to join us. see the contributing guidelines for more details.

License

© 2019, Clivern. Released under Apache License, Version 2.0.

Kangaroo is authored and maintained by @Clivern.

Версии библиотеки

Версия
0.0.1