Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/foxcapades/java-json-schema-builder
https://github.com/foxcapades/java-json-schema-builder
Last synced: 5 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/foxcapades/java-json-schema-builder
- Owner: Foxcapades
- License: mit
- Created: 2019-04-22T00:47:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-04-30T00:48:50.000Z (over 5 years ago)
- Last Synced: 2024-10-17T01:19:39.609Z (20 days ago)
- Language: Java
- Size: 236 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: readme.adoc
- License: LICENSE
Awesome Lists containing this project
README
= JSON Schema Builder
:source-highlighter: pygments
Elizabeth Harperimage:https://img.shields.io/badge/JDK-11-orange.svg[]
image:https://img.shields.io/travis/Foxcapades/java-json-schema-builder/master.svg[link="https://travis-ci.org/Foxcapades/java-json-schema-builder"]
image:https://img.shields.io/maven-central/v/io.vulpine.lib/json-schema-builder.svg[link="https://search.maven.org/search?q=g:io.vulpine.lib%20AND%20a:json-schema-builder"]
image:https://codecov.io/gh/Foxcapades/java-json-schema-builder/branch/master/graph/badge.svg[link="https://codecov.io/gh/Foxcapades/java-json-schema-builder"]
image:https://img.shields.io/github/license/Foxcapades/java-json-schema-builder.svg[]https://github.com/FasterXML/jackson[Jackson] based builder for constructing
JSON Schema in Java.== Drafts
=== v4
[source, java]
----
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()));
----[source, json]
----
{
"$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
[cols=3]
|===
h| Status h| Feature h| Notes
| [red]#*TODO*# | `"dependencies"` | Target 2.3
| [green]#*Done*# | `"not"` | In 2.0
| [green]#*Done*# | `"minProperties"` | In 1.2
| [green]#*Done*# | `"maxProperties"` | In 1.2
| [green]#*Done*# | `"uniqueItems"` | In 1.2
| [green]#*Done*# | `"definitions"` | In 1.2
| [green]#*Done*# | Multi-type nodes | In 1.3
| [green]#*Done*# | `"format"` | In 1.1
| [green]#*Done*# | `"enum"` | In 1.1
| [green]#*Done*# | `"oneOf"` | In 1.1, Complete in 1.3
| [green]#*Done*# | `"anyOf"` | In 1.1, Complete in 1.3
| [green]#*Done*# | `"allOf"` | In 1.1, Complete in 1.3
|====== v7
* [ ] support