fix(deps): update fory to v1.7.0 - #83
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.6.1→1.7.01.6.1→1.7.0Release Notes
apache/fory (org.apache.fory:fory-kotlin)
v1.7.0Highlights
JSON Support for Scala
Fory 1.7.0 introduces
fory-json-scalafor Scala 2.13 and Scala 3. Scala applications can read and write standard JSON using case classes, constructor defaults,Option,Either, tuples, collections, maps, and value classes. The module works on the JVM and GraalVM Native Image.Add the Scala JSON module to your sbt build:
Create a reusable
ForyJsoninstance withForyJsonScala.builder(). Missing defaulted parameters use Scala's compiler-generated constructor defaults, so immutable case classes do not need a zero-argument constructor or mutable fields:Fory JSON annotations work on Scala constructor properties. Scala 2
Enumerationvalues can useJsonEnumerationto retain their owning enumeration, including values inside collections and maps. On Scala 3,derives ScalaJsonCodecsupports enums with parameterized cases and, together withJsonSubTypes, sealed hierarchies whose allowed subtypes are declared by the application.Use a complete
TypeReffor parameterized types, orScalaTypeRefwhen Scala value-type arguments would otherwise be erased. See the Scala JSON guide for supported types, annotations, and Native Image setup.JSON Support for Kotlin
The new
fory-json-kotlinmodule maps Kotlin models to standard JSON while preserving constructor defaults, nullability, unsigned types, value classes, and generic arguments. It supports the JVM, Android API 26 and later, and GraalVM Native Image without requiringkotlin-reflect.Add the runtime dependency:
dependencies { implementation("org.apache.fory:fory-json-kotlin:1.7.0") }Use
jsonTypeRef<T>()to retain Kotlin type information at the root and in nested values. Ordinary Java type tokens cannot represent every Kotlin distinction, such as nullable collection elements or a value class lowered to a primitive:A missing member invokes its constructor default when one exists. An explicit JSON
nullis checked against the Kotlin declaration and never requests a default. Fory calls the model's constructor, so initialization and validation still run. Sealed classes and interfaces can useJsonSubTypesto declare a closed set of logical subtype names.On Android, runtime JSON code generation is disabled. Use the
fory-json-kotlin-kspprocessor when R8 or ProGuard shrinks Kotlin models, together withJsonTypeon application models or an exactJsonMixinfor third-party targets. For Native Image, installForyJsonKotlinin a reachableForyJsonProviderconfiguration and make the required models and exact generic bindings reachable at build time. See the Kotlin JSON guide, Android guide, and GraalVM Native Image guide for setup and supported configurations.Incremental JSON Stream Decoding
Fory JSON can now decode a top-level array or NDJSON stream as UTF-8 chunks arrive. Applications can process each completed element or record without buffering the complete document or waiting for the end of the stream. Chunks are supplied as
ByteBufferinstances and can end partway through a JSON value.Use
newArrayStreamDecoderfor one top-level JSON array. Each successfuldecodeNextcall exposes one decoded element throughvalue():Use
newNdjsonStreamDecoderfor records separated by LF or CRLF. Callfinish()at the end of input and consume its value when it returnstrue: this handles a final record without a trailing newline.Drain each chunk before supplying the next one. The required
maxValueBytesargument limits each array element or NDJSON record, rather than the complete stream. A decoder belongs to one stream, is not thread-safe, and cannot be reused after completion or failure. See Incremental JSON streams for buffer ownership, null values, and byte-limit details.Features
Bug Fix
Other Improvements
New Contributors
Full Changelog: apache/fory@v1.6.1...v1.7.0
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate CLI.