json-schema-formats
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:Format specifiers to use with json-schema-validator

Read me first

The license of this project is LGPLv3 or later. See file src/main/resources/LICENSE for the full text.

Note: this project is for the 2.0.x version of json-schema-validator; starting with 2.1.x, the format attributes defined in this package are integrated into json-schema-validator itself.

What it is

This is a project implementing format attributes not included in the JSON Schema drafts, which can be used to extend the validation capabilities of json-schema-validator.

Versions

The current version is 2.0.0.

Maven artifact

Replace your-version-here with the appropriate version:

```xml com.github.fge json-schema-formats your-version-here ```

Sample usage

This package comes with a dictionary of all defined format attributes. In order to use it, you need to create your own keyword library and add the format attributes you want to it. For instance, here is how you add the sha1 format attribute:

```java final Dictionary dict = ExtraFormatsDictionary.get(); final LibraryBuilder lib = DraftV4Library.get().thaw(); lib.addFormatAttribute("json-pointer", dict.entries().get("json-pointer")); final ValidationConfigurationBuilder cfg = ValidationConfiguration.newBuilder(); cfg.addLibrary("foo://bar", lib.freeze()); final JsonSchemaFactory factory = JsonSchemaFactory.newBuilder() .setValidationConfiguration(cfg.freeze()).freeze(); // Now use the factory ```

List of format attributes

This is the list of format attributes supported by this package.:

* base64, * md5, * sha1 (yes, git commit IDs use that), * sha256, * sha512, * mac, * json-pointer, * uri-template.

See the wiki for more information.


本源码包内暂不包含可直接显示的源代码文件,请下载源码包。