Skip to content

Jackson Serialization doesn't work on java.time #921

@SZanko

Description

@SZanko

Expected Behavior

Micronaut does serialize ExampleDto correctly with values from request

Actual Behaviour

An instance of ExampleDto is created but the values of the field is null

logs:

Received Tour: null, Duration: null

Steps To Reproduce

  1. gradle run
  2. run
curl -X POST http://localhost:8080/example \
-H "Content-Type: application/json" \
-d '{
  "name": "City Tour",
  "duration": "PT2H30M"
}'

Environment Information

  • OS: archlinux
  • jdk version: #openjdk 17.0.12 2024-07-16
    OpenJDK Runtime Environment (build 17.0.12+7)
    OpenJDK 64-Bit Server VM (build 17.0.12+7, mixed mode, sharing)

Example Application

https://github.com/SZanko/MicronautJavaTimeSerializationTest

Version

4.6.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions