jackson-json-reference-core

JSON Reference for Java with Jackson.

License

License

GNU Lesser General Public License (LGPL), Version 3.0
Categories

Categories

JSON Data Jackson
GroupId

GroupId

me.andrz.jackson
ArtifactId

ArtifactId

jackson-json-reference-core
Last Version

Last Version

0.3.2
Release Date

Release Date

Type

Type

jar
Description

Description

jackson-json-reference-core
JSON Reference for Java with Jackson.
Project URL

Project URL

https://github.com/AndersDJohnson/jackson-json-reference
Source Code Management

Source Code Management

https://github.com/AndersDJohnson/jackson-json-reference

Download jackson-json-reference-core

How to add to project

<!-- https://jarcasting.com/artifacts/me.andrz.jackson/jackson-json-reference-core/ -->
<dependency>
    <groupId>me.andrz.jackson</groupId>
    <artifactId>jackson-json-reference-core</artifactId>
    <version>0.3.2</version>
</dependency>
// https://jarcasting.com/artifacts/me.andrz.jackson/jackson-json-reference-core/
implementation 'me.andrz.jackson:jackson-json-reference-core:0.3.2'
// https://jarcasting.com/artifacts/me.andrz.jackson/jackson-json-reference-core/
implementation ("me.andrz.jackson:jackson-json-reference-core:0.3.2")
'me.andrz.jackson:jackson-json-reference-core:jar:0.3.2'
<dependency org="me.andrz.jackson" name="jackson-json-reference-core" rev="0.3.2">
  <artifact name="jackson-json-reference-core" type="jar" />
</dependency>
@Grapes(
@Grab(group='me.andrz.jackson', module='jackson-json-reference-core', version='0.3.2')
)
libraryDependencies += "me.andrz.jackson" % "jackson-json-reference-core" % "0.3.2"
[me.andrz.jackson/jackson-json-reference-core "0.3.2"]

Dependencies

compile (3)

Group / Artifact Type Version
org.slf4j : slf4j-api jar 1.7.10
com.fasterxml.jackson.core : jackson-databind jar 2.4.3
commons-io : commons-io jar 2.4

provided (1)

Group / Artifact Type Version
com.fasterxml.jackson.dataformat : jackson-dataformat-yaml jar 2.4.3

test (4)

Group / Artifact Type Version
org.slf4j : slf4j-simple jar 1.7.10
org.eclipse.jetty : jetty-server jar 9.3.0.M0
junit : junit jar 4.9
org.hamcrest : hamcrest-all jar 1.3

Project Modules

There are no modules declared in this project.

jackson-json-reference

Parent: Build Status Codecov

  • Core: Download Core
  • CLI:   Download CLI

JSON Reference implementation for Java, based on Jackson. Process references in JSON documents, such as in JSON Schema. Aims for but not limited to full spec compliance.

Features

  • Supports URLs & files.
  • Relative & absolute reference URIs.
  • Recursive expansion, with options for max depth and stop on circularity.
  • Custom object mappers, allowing Jackson features like JSON comments, YAML, etc.
  • Built-in support for YAML based on file extension detection.

Specs

Usage

File

File file = new File("src/test/resources/nest.json");
JsonNode node = (new JsonReferenceProcessor()).process(file);

URL

URL url = new URL("http://json-schema.org/schema");
JsonNode node = (new JsonReferenceProcessor()).process(url);

Settings

JsonReferenceProcessor processor = new JsonReferenceProcessor();

processor.setStopOnCircular(false); // default true

processor.setMaxDepth(2); // default 1, or set to -1 for no max depth

// Custom object mapper allowing comments.
processor.setMapperFactory(new ObjectMapperFactory() {
   @Override
   public ObjectMapper create(URL url) {
       //ObjectMapper objectMapper = DefaultObjectMapperFactory.instance.create(url);
       ObjectMapper objectMapper = new ObjectMapper();
       objectMapper.configure(JsonParser.Feature.ALLOW_COMMENTS, true);
       return objectMapper;
   }
});

JsonNode node = processor.process( /*...*/ );

Output

ObjectMapper mapper = new ObjectMapper();
mapper.writeValue(new File("out.json"), node);

Install

Maven

<dependencies>
    <dependency>
        <groupId>me.andrz.jackson</groupId>
        <artifactId>jackson-json-reference-core</artifactId>
        <version>0.3.2</version>
    </dependency>
</dependencies>

Gradle

repositories {
    mavenCentral()
}

dependencies {
    compile 'me.andrz.jackson:jackson-json-reference-core:0.3.2'
}

Manual

Download JAR(s) from Maven Central:

  • Core: Download Core
  • CLI:   Download CLI

License

See LICENSE.

Development

Publishing

If you need to bump the version of all projects in the multi-project:

mvn versions:set -DnewVersion=2.50.1-SNAPSHOT

Then be sure your build is up to date:

mvn compile

Now, use the Release Plugin (http://maven.apache.org/maven-release/maven-release-plugin/usage.html):

mvn release:prepare -DdryRun=true
mvn release:prepare

If you mess up:

mvn release:clean

Else:

mvn release:perform

Versions

Version
0.3.2
0.3.1
0.3.0
0.2.1