Skip to content

feat : Adding support for YAML serialization/deserialization#1283

Draft
ZARAYACH wants to merge 18 commits into
micronaut-projects:3.1.xfrom
ZARAYACH:feat_support_yaml
Draft

feat : Adding support for YAML serialization/deserialization#1283
ZARAYACH wants to merge 18 commits into
micronaut-projects:3.1.xfrom
ZARAYACH:feat_support_yaml

Conversation

@ZARAYACH

Copy link
Copy Markdown

This pr aims to add support for YAML serialization/deserialization

@ZARAYACH ZARAYACH changed the base branch from 3.0.x to 3.1.x June 22, 2026 12:47
@dstepanov dstepanov marked this pull request as ready for review June 30, 2026 12:37
@dstepanov dstepanov marked this pull request as draft June 30, 2026 12:37
Comment thread serde-yaml/build.gradle.kts Outdated
implementation(mn.micronaut.context)
implementation(mn.micronaut.core)
implementation(projects.micronautSerdeApi)
implementation(mn.snakeyaml)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought there was a lower level dependency we could depend on here?

@khamzatMurj khamzatMurj Jul 5, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If you meant low level one is snakeyaml engine. No we can't depend on snake-yaml engine, Bacause The Core BOM currently exposes only org.yaml:snakeyaml.

and if you want to introduce org.snakeyaml:snakeyaml-engine in the Bom or libs-version.toml we only need to replace org.yaml.snakeyaml.* APIs with org.snakeyaml.engine.v2.* imports with small changes.

-I've test it locally no break changes on the pr.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@graemerocher also the jackson-databind itself rely on the snakeyaml-engine as dependency as well.
which is technically the same low level classes(Emitter, Event, Node ...) I used in encoder and decoder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the point is to depend only on org.snakeyaml:snakeyaml-engine not on the entirety of snakeyaml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Introduced by @sdelamo thank you.

@khamzatMurj khamzatMurj force-pushed the feat_support_yaml branch 2 times, most recently from d01da7a to 3ffc7d1 Compare July 8, 2026 09:27
sdelamo and others added 5 commits July 8, 2026 18:48
- Allow Long Keys
- Using Yaml Non Finite Notation
- Indent arrays
- IndentArrays with Indicator
- Canonical output
setting the UTF8 as StandardCharsets.
@khamzatMurj

Copy link
Copy Markdown
Contributor

This current implementation now lacking these configuration as the upstream jackson-dataformat-yaml does :

  • USE_NATIVE_OBJECT_ID
  • USE_NATIVE_TYPE_ID

these limitation is because micronaut-serialization not supporting @JsonIdentityInfo & @JsonIdentityReference. imo Native type IDs would need a separate cross-module feature.

these are the jackson tests for the desired behavior : Tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants