Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump kotlinx-serialization-json from 1.4.1 to 1.5.0 #31408

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 24, 2023

Bumps kotlinx-serialization-json from 1.4.1 to 1.5.0.

Release notes

Sourced from kotlinx-serialization-json's releases.

1.5.0

This release contains all features and bugfixes from 1.5.0-RC plus some experimental features and bugfixes on its own (see below). Kotlin 1.8.10 is used as a default.

HoconEncoder and HoconDecoder interfaces and HOCON-specific serializers

These interfaces work in a way similar to JsonEncoder and JsonDecoder: they allow intercepting (de)serialization process, making writing if custom HOCON-specific serializers easier. New ConfigMemorySizeSerializer and JavaDurationSerializer already make use of them. See more details in the PR. Big thanks to Alexander Mikhailov for contributing this!

Ability to read buffered huge strings in custom Json deserializers

New interface ChunkedDecoder allows you to read huge strings that may not fit in memory by chunks. Currently, this interface is only implemented by Json decoder that works with strings and streams, but we may expand it later, if there's a demand for it. See more details in the PR authored by Alexey Sviridov.

Bugfixes

  • Improve runtime exceptions messages (#2180)
  • Added support for null values for nullable enums in lenient mode (#2176)
  • Prevent class loaders from leaking when using ClassValue cache (#2175)

1.5.0-RC

This is a release candidate for the next version with many new features to try. It uses Kotlin 1.8.0 by default.

Json naming strategies

A long-awaited feature (#33) is available in this release. A new interface, JsonNamingStrategy and Json configuration property namingStrategy allow defining a transformation that is applied to all properties' names serialized by a Json instance. There's also a predefined implementation for the most common use case: Json { namingStrategy = JsonNamingStrategy.SnakeCase }. Check out the PR for more details and documentation.

Json unquoted literals

kotlinx-serialization-json has an API for manipulating raw Json values: functions and classes JsonObject, JsonPrimitive, etc. In this release, there is a new addition to this API: JsonUnquotedLiteral constructor function. It allows to produce a string that is not quoted in the Json output. This function has a lot of valuable applications: from writing unsigned or large numbers to embedding whole Json documents without the need for re-parsing. For an example, read the Encoding literal Json content docs. This huge feature was contributed to us by aSemy: #2041.

Stabilization of serializer(java.lang.Type) function family

Functions serializer, serializerOrNull and extensions SerializersModule.serializer, SerializersModule.serializerOrNull have JVM-only overloads that accept java.lang.Type. These overloads are crucial for interoperability: with them, third-party Java frameworks like Spring, which usually rely on Java's reflection and type tokens, can retrieve KSerializer instance and use kotlinx.serialization properly.

... (truncated)

Changelog

Sourced from kotlinx-serialization-json's changelog.

1.5.0 / 2023-02-27

This release contains all features and bugfixes from 1.5.0-RC plus some experimental features and bugfixes on its own (see below). Kotlin 1.8.10 is used as a default.

HoconEncoder and HoconDecoder interfaces and HOCON-specific serializers

These interfaces work in a way similar to JsonEncoder and JsonDecoder: they allow intercepting (de)serialization process, making writing if custom HOCON-specific serializers easier. New ConfigMemorySizeSerializer and JavaDurationSerializer already make use of them. See more details in the PR. Big thanks to Alexander Mikhailov for contributing this!

Ability to read buffered huge strings in custom Json deserializers

New interface ChunkedDecoder allows you to read huge strings that may not fit in memory by chunks. Currently, this interface is only implemented by Json decoder that works with strings and streams, but we may expand it later, if there's a demand for it. See more details in the PR authored by Alexey Sviridov.

Bugfixes

  • Improve runtime exceptions messages (#2180)
  • Added support for null values for nullable enums in lenient mode (#2176)
  • Prevent class loaders from leaking when using ClassValue cache (#2175)

1.5.0-RC / 2023-01-25

This is a release candidate for the next version with many new features to try. It uses Kotlin 1.8.0 by default.

Json naming strategies

A long-awaited feature (#33) is available in this release. A new interface, JsonNamingStrategy and Json configuration property namingStrategy allow defining a transformation that is applied to all properties' names serialized by a Json instance. There's also a predefined implementation for the most common use case: Json { namingStrategy = JsonNamingStrategy.SnakeCase }. Check out the PR for more details and documentation.

Json unquoted literals

kotlinx-serialization-json has an API for manipulating raw Json values: functions and classes JsonObject, JsonPrimitive, etc. In this release, there is a new addition to this API: JsonUnquotedLiteral constructor function. It allows to produce a string that is not quoted in the Json output. This function has a lot of valuable applications: from writing unsigned or large numbers to embedding whole Json documents without the need for re-parsing. For an example, read the Encoding literal Json content docs. This huge feature was contributed to us by aSemy: #2041.

Stabilization of serializer(java.lang.Type) function family

... (truncated)

Commits
  • 8a2c1c0 Prepare 1.5.0 release (#2207)
  • 88f782c Removed redundant usages of @​Serializer annotations (#2200)
  • e9b9064 ~lower coverage percentage
  • b6e9f4b Merge remote-tracking branch 'origin/master' into dev
  • acb0988 Introduce HoconEncoder and HoconDecoder interfaces (#2094)
  • 90113a9 Added ability to read buffered huge strings in custom KSerializers (#2012)
  • 623dcad Use the same message in intrinsified serializer() and reflective serializer()
  • 270b5e5 Improve message about missing polymorphic serializer
  • 2cb7f7d Added support for null values for nullable enums in lanient mode (#2176)
  • b454f34 Prevent class loaders from leaking when using ClassValue cache (#2175)
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

@dependabot dependabot bot added the area/dependencies Pull requests that update a dependency file label Feb 24, 2023
@quarkus-bot

This comment has been minimized.

@gsmet
Copy link
Member

gsmet commented Feb 27, 2023

Hey @evanchooly , looks like this Kotlin-related upgrade is breaking our tests.

I'm just talking about this one as the others are not related:

io.quarkus.kotlin.serialization.JsonConfigTest.ensureJsonCoverage

@evanchooly evanchooly self-assigned this Feb 28, 2023
Bumps [kotlinx-serialization-json](https://github.com/Kotlin/kotlinx.serialization) from 1.4.1 to 1.5.0.
- [Release notes](https://github.com/Kotlin/kotlinx.serialization/releases)
- [Changelog](https://github.com/Kotlin/kotlinx.serialization/blob/master/CHANGELOG.md)
- [Commits](Kotlin/kotlinx.serialization@v1.4.1...v1.5.0)

---
updated-dependencies:
- dependency-name: org.jetbrains.kotlinx:kotlinx-serialization-json
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot force-pushed the dependabot/maven/org.jetbrains.kotlinx-kotlinx-serialization-json-1.5.0 branch from 6f61554 to 959162c Compare February 28, 2023 22:59
@quarkus-bot

This comment has been minimized.

@gsmet gsmet marked this pull request as draft March 1, 2023 15:06
@evanchooly evanchooly requested a review from geoand March 1, 2023 21:11
@quarkus-bot quarkus-bot bot added the area/rest label Mar 1, 2023
@evanchooly evanchooly marked this pull request as ready for review March 1, 2023 21:23
@quarkus-bot
Copy link

quarkus-bot bot commented Mar 2, 2023

Failing Jobs - Building f780649

Status Name Step Failures Logs Raw logs
JVM Tests - JDK 11 Build ⚠️ Check → Logs Raw logs
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 17
✔️ JVM Tests - JDK 19
Native Tests - Misc4 Build Failures Logs Raw logs

Full information is available in the Build summary check run.

Failures

⚙️ Native Tests - Misc4 #

- Failing: integration-tests/opentelemetry-jdbc-instrumentation 

📦 integration-tests/opentelemetry-jdbc-instrumentation

io.quarkus.it.opentelemetry.PostgresOpenTelemetryJdbcInstrumentationIT.testPostgreSqlQueryTraced - More details - Source on GitHub

java.lang.AssertionError: 
1 expectation failed.
Expected status code <200> but was <500>.

Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change work in native mode?

Asking because I don't see how the strategy classes are registered for reflection

* </ol>
*/
@ConfigItem(name = "naming-strategy")
public Optional<String> namingStrategy;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't really need to be optional as we are supplying a default value.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprisingly this does work in native mode. I was surprised, too, because there were no @RegisterForReflection annotations. I thought maybe the when statement in the test directly referencing the custom JsonNamingStrategy might be tripping some wires but I changed that to a String instead and it still works. I can see printlns I added in both the JVM and native tests. My hypothesis at this point is that since JsonNamingStrategy shows up in the other parts of the API that graalvm makes a note and tracks all the subclasses it finds of that type. I honestly don't know otherwise.

As for the Optional, does null count as a default value? The impression I got looking at other configs was "no." It truly is an optional config element and kotlin serialization will happily chug along without it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting about native mode.

As for the Optional thing, we can do it like you have it, just saying that Optional is unnecessary as you have provided a default value

@evanchooly evanchooly merged commit 45c38c1 into main Mar 2, 2023
@quarkus-bot quarkus-bot bot added this to the 3.0 - main milestone Mar 2, 2023
@dependabot dependabot bot deleted the dependabot/maven/org.jetbrains.kotlinx-kotlinx-serialization-json-1.5.0 branch March 2, 2023 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants