Json Schema Builder

Java API for constructing json schema

License

License

MIT
Categories

Categories

JSON Data
GroupId

GroupId

io.vulpine.lib
ArtifactId

ArtifactId

json-schema-builder
Last Version

Last Version

2.2.0
Release Date

Release Date

Type

Type

pom
Description

Description

Json Schema Builder
Java API for constructing json schema
Project URL

Project URL

https://github.com/Foxcapades/java-json-schema-builder
Project Organization

Project Organization

Vulpine IO
Source Code Management

Source Code Management

https://github.com/Foxcapades/java-json-schema-builder

Download json-schema-builder

How to add to project

<!-- https://jarcasting.com/artifacts/io.vulpine.lib/json-schema-builder/ -->
<dependency>
    <groupId>io.vulpine.lib</groupId>
    <artifactId>json-schema-builder</artifactId>
    <version>2.2.0</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/io.vulpine.lib/json-schema-builder/
implementation 'io.vulpine.lib:json-schema-builder:2.2.0'
// https://jarcasting.com/artifacts/io.vulpine.lib/json-schema-builder/
implementation ("io.vulpine.lib:json-schema-builder:2.2.0")
'io.vulpine.lib:json-schema-builder:pom:2.2.0'
<dependency org="io.vulpine.lib" name="json-schema-builder" rev="2.2.0">
  <artifact name="json-schema-builder" type="pom" />
</dependency>
@Grapes(
@Grab(group='io.vulpine.lib', module='json-schema-builder', version='2.2.0')
)
libraryDependencies += "io.vulpine.lib" % "json-schema-builder" % "2.2.0"
[io.vulpine.lib/json-schema-builder "2.2.0"]

Dependencies

runtime (2)

Group / Artifact Type Version
com.fasterxml.jackson.core : jackson-databind jar 2.9.8
com.fasterxml.jackson.core : jackson-annotations jar 2.9.8

Project Modules

There are no modules declared in this project.

JSON Schema Builder

JDK 11 orange master json schema builder badge java json schema builder

Jackson based builder for constructing JSON Schema in Java.

Drafts

v4

var writer = new ObjectMapper().writerWithDefaultPrettyPrinter();
var schema = Schema.draft4();
System.out.println(writer.writeValueAsString(
  schema.asObject()
    .requiredProperty("test")
      .asArray()
      .items()
        .asString()
        .defaultValue("some value")
        .close()
      .close()
    .optionalProperty("other", schema.id("test"))
    .render()));
{
  "$schema" : "http://json-schema.org/draft-04/schema",
  "type" : "object",
  "required" : [ "test" ],
  "properties" : {
    "test" : {
      "type" : "array",
      "items" : {
        "type" : "string",
        "default" : "some value"
      }
    },
    "other" : {
      "id" : "test"
    }
  }
}

TODO

v4

Status

Feature

Notes

TODO

"dependencies"

Target 2.3

Done

"not"

In 2.0

Done

"minProperties"

In 1.2

Done

"maxProperties"

In 1.2

Done

"uniqueItems"

In 1.2

Done

"definitions"

In 1.2

Done

Multi-type nodes

In 1.3

Done

"format"

In 1.1

Done

"enum"

In 1.1

Done

"oneOf"

In 1.1, Complete in 1.3

Done

"anyOf"

In 1.1, Complete in 1.3

Done

"allOf"

In 1.1, Complete in 1.3

v7

  • ❏ support

Versions

Version
2.2.0
2.1.0
2.0.0
1.2.0
1.1.0
1.0.0