Skip to content

Version 0.7.2

Latest
Compare
Choose a tag to compare
@FoxSamu FoxSamu released this 17 Nov 13:46

From here and onwards, I will add releases to GitHub. Artifacts are still on Maven.

Changelog

  • Split Kotlin to separate artifact.

Installation

The artifact can be installed from my Maven repository.

Gradle

repositories {
    // Add my repository
    maven { url "https://maven.shadew.net/" }
}

dependencies {
    // Add the artifact
    implementation "dev.runefox:json:0.7.2"
}

Maven

<repositories>
    <!-- Add my repository -->
    <repository>
        <id>Runefox Maven</id>
        <url>https://maven.shadew.net/</url>
    </repository>
</repositories>

<dependencies>
    <!-- Add the artifact -->
    <dependency>
        <groupId>dev.runefox</groupId>
        <artifactId>json</artifactId>
        <version>0.7.2</version>
    </dependency>
</dependencies>

Download

You can also manually download the artifacts manually from my Maven repository:

Changelog of older versions, for reference

0.7.1

  • Fixed NPE in JsonNode.stream().

0.7

  • Added ObjectCodecBuilder, a builder for JsonCodecs that significantly simplifies making codecs that serialize Java objects to JSON objects with similar fields.
  • JsonCodec.ofEnum now has overloads that accept an enum's values() array instead of a class instance.
  • Removed some more UncheckedIOException usages.

0.6.4

  • Kotlin is no longer a transitive dependency of the library. To use with Kotlin, the Kotlin dependency must be added
    manually.

0.6.3

  • Properly support unsigned integer types in Kotlin.
  • Codecs for Kotlin's unsigned integer types, and range types.
  • Document Kotlin API.

0.6.2

  • In Kotlin, it is now possible to invoke JsonNodes with a function as argument to configure them.

0.6.1

  • Introducing support for Kotlin.

0.6

  • JsonSyntaxException now provides getters for the exact location and problem of the error.
  • Added various new JsonCodecs for different TemporalAccessor types.
  • There are now instance methods on JsonCodec that create wrapper codecs. They all have an equivalent static factory method.
  • Parsing and serializing now throws IOExceptions instead of UncheckedIOExceptions.
  • Fixed the issue causing JsonInput trying to read from the stream beyond the end of the document, causing a blocking stream (such as a socket stream) to block even though an entire document has been read and is ready to be handled.

0.5.2

  • Added flush() to JsonOutput.

0.5.1

  • Added support for streaming multiple JSON documents over a single stream, through two new interfaces JsonInput and JsonOutput.
  • The project now has a named module and can now be used as a dependency in other module-based projects.

0.5

  • Changed base package name and artifact group from net.shadew to dev.runefox
  • Added merge(...) which merges an object into the main object
  • Added JsonNode.arrayCollector(...) that takes a mapping function to quickly map Java objects to JSON in a Stream.
  • Added JsonNode.objectCollector(...) that takes two mapping functions to collect elements into an object.
  • Added wrap() to quickly wrap a node into a new array and wrap(...) to quickly wrap a node into a new object under a given key.
  • The JsonNode.numberArray(...) methods taking primitives no longer accept varargs, except for the one taking Number objects, because the Java compiler would find it ambiguous otherwise.
  • Fixed serializer expecting an object or array despite FormattingConfig.anyValue being set to true.

0.4

  • Added new methods for checking values of object elements (i.e. isBoolean(String key))
  • Added MissingKeyException that can be thrown when a required key is missing
  • Fixed isPrimitive returning true for all JSON structures and isConstruct returning false for all JSON structures
  • Deprecated JsonPath and JsonNode.query(...) methods

0.3.2

  • Fixed NoSuchMethodError with Android not desugaring toArray(IntFunction)

0.3.1

  • Fixed floating point numbers between 0 and 1 being rounded to 0 in JsonNode.number()

0.3

  • Added the codec system for easy encoding and decoding of Java objects to/from JSON trees
  • Fixed toString returning dev.runefox.json.BooleanNode@..... for boolean types, making toString JSON data not parsable
  • A new unchecked exception, JsonException, is now the superclass of all the exceptions thrown by the assertions in JsonNode methods, as well as exceptions thrown from codecs
  • Added JsonNode.arrayCollector() for easily collecting all JsonNodes in a Stream into an array node
  • The numeric values returned from JsonNodes should now be closer to the actual value stored in the JSON data
  • JsonRepresentable now replaces JsonSerializable, and a JsonNode is now JsonRepresentable
  • JsonNode.fromJavaObject is now deprecated and only for debug purposes
  • Improved documentation

0.2.1

  • Add methods to create array nodes from arrays of primitives

0.2

  • It's now possible to parse JSON that is not an object or array at root (can enabled in ParsingConfig)
  • Added Json presets with compact printing
  • Various new JsonNode API for reading and writing a JSON structure
  • IncorrectArrayLengthException has been replaced with IncorrectSizeException
  • JsonType has now has some extra API
  • Serializing a JSON node that is not an object or array now throws an exception (this check can be disabled in FormattingConfig)
  • Surrogate pairs are now treated as one code point when parsing
  • Improved documentation

0.1

Initial release