Skip to content

Commit e4a8543

Browse files
authored
Merge pull request #23 from aether-framework/feature/supporting-extra-ops
Deprecate legacy codec modules and add null validation handling
2 parents dc4502e + ecb0188 commit e4a8543

133 files changed

Lines changed: 16146 additions & 825 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 88 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,76 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
88

99
## [0.4.0] - 2026-01-09
1010

11+
### Breaking Changes
12+
13+
#### Package Restructuring in `aether-datafixers-codec`
14+
15+
The codec module has been restructured to use a format-first package organization. This is a **breaking change** that requires updating import statements.
16+
17+
**Old Package Structure:**
18+
```
19+
de.splatgames.aether.datafixers.codec.gson.GsonOps
20+
de.splatgames.aether.datafixers.codec.jackson.JacksonOps
21+
```
22+
23+
**New Package Structure:**
24+
```
25+
de.splatgames.aether.datafixers.codec.json.gson.GsonOps
26+
de.splatgames.aether.datafixers.codec.json.jackson.JacksonJsonOps
27+
de.splatgames.aether.datafixers.codec.yaml.snakeyaml.SnakeYamlOps
28+
de.splatgames.aether.datafixers.codec.yaml.jackson.JacksonYamlOps
29+
de.splatgames.aether.datafixers.codec.toml.jackson.JacksonTomlOps
30+
de.splatgames.aether.datafixers.codec.xml.jackson.JacksonXmlOps
31+
```
32+
33+
**Migration Steps:**
34+
1. Update imports from `codec.gson.GsonOps` to `codec.json.gson.GsonOps`
35+
2. Update imports from `codec.jackson.JacksonOps` to `codec.json.jackson.JacksonJsonOps`
36+
3. Rename `JacksonOps` references to `JacksonJsonOps`
37+
1138
### Added
1239

40+
#### Multi-Format DynamicOps Implementations (`aether-datafixers-codec`)
41+
42+
New DynamicOps implementations for YAML, TOML, and XML formats:
43+
44+
**YAML Support:**
45+
- `SnakeYamlOps` — Uses native Java types (`Map`, `List`, primitives) via SnakeYAML 2.x
46+
- `JacksonYamlOps` — Uses `JsonNode` via Jackson YAML dataformat module
47+
48+
**TOML Support:**
49+
- `JacksonTomlOps` — Uses `JsonNode` via Jackson TOML dataformat module
50+
- Note: TOML requires top-level tables and doesn't support null values
51+
52+
**XML Support:**
53+
- `JacksonXmlOps` — Uses `JsonNode` via Jackson XML dataformat module
54+
- Note: XML requires a root element and has different structural semantics
55+
56+
**New Dependencies (all optional):**
57+
```xml
58+
<dependency>
59+
<groupId>org.yaml</groupId>
60+
<artifactId>snakeyaml</artifactId>
61+
<version>2.2</version>
62+
<optional>true</optional>
63+
</dependency>
64+
<dependency>
65+
<groupId>com.fasterxml.jackson.dataformat</groupId>
66+
<artifactId>jackson-dataformat-yaml</artifactId>
67+
<optional>true</optional>
68+
</dependency>
69+
<dependency>
70+
<groupId>com.fasterxml.jackson.dataformat</groupId>
71+
<artifactId>jackson-dataformat-toml</artifactId>
72+
<optional>true</optional>
73+
</dependency>
74+
<dependency>
75+
<groupId>com.fasterxml.jackson.dataformat</groupId>
76+
<artifactId>jackson-dataformat-xml</artifactId>
77+
<optional>true</optional>
78+
</dependency>
79+
```
80+
1381
#### Spring Boot Starter Module (`aether-datafixers-spring-boot-starter`)
1482

1583
New module providing seamless Spring Boot integration with auto-configuration, fluent migration API, and observability features.
@@ -26,7 +94,13 @@ New module providing seamless Spring Boot integration with auto-configuration, f
2694
**Configuration Properties (`spring.config`):**
2795
- `AetherDataFixersProperties` — Root configuration with `aether.datafixers.*` prefix
2896
- `DataFixerDomainProperties` — Per-domain configuration (version, primary, description)
29-
- `DynamicOpsFormat` — Enum for selecting default serialization format (GSON, JACKSON)
97+
- `DynamicOpsFormat` — Enum for selecting default serialization format:
98+
- `GSON` — JSON via Google Gson
99+
- `JACKSON` — JSON via Jackson Databind
100+
- `JACKSON_YAML` — YAML via Jackson dataformat
101+
- `SNAKEYAML` — YAML via SnakeYAML (native Java types)
102+
- `JACKSON_TOML` — TOML via Jackson dataformat
103+
- `JACKSON_XML` — XML via Jackson dataformat
30104
- `ActuatorProperties` — Control schema/fix detail exposure in actuator responses
31105
- `MetricsProperties` — Configure timing, counting, and domain tag name
32106

@@ -67,6 +141,19 @@ New module providing seamless Spring Boot integration with auto-configuration, f
67141

68142
### Documentation
69143

144+
#### Codec Formats Documentation
145+
- Added new `docs/codec/` section with comprehensive format documentation
146+
- [Codec Overview](docs/codec/index.md) — Format comparison, package structure, dependency guide
147+
- [JSON Support](docs/codec/json.md) — GsonOps and JacksonJsonOps usage, examples, comparison
148+
- [YAML Support](docs/codec/yaml.md) — SnakeYamlOps and JacksonYamlOps usage, examples, comparison
149+
- [TOML Support](docs/codec/toml.md) — JacksonTomlOps usage, configuration file examples
150+
- [XML Support](docs/codec/xml.md) — JacksonXmlOps usage, XML-to-JsonNode mapping
151+
- Updated [Dynamic System](docs/concepts/dynamic-system.md) with all DynamicOps implementations table
152+
- Updated [Codec System](docs/concepts/codec-system.md) with links to format-specific docs
153+
- Updated [How-To Index](docs/how-to/index.md) with Format Integration section
154+
- Updated [Custom DynamicOps Tutorial](docs/tutorials/custom-dynamicops.md) with built-in implementations reference
155+
156+
#### Spring Boot Integration Documentation
70157
- Added comprehensive Spring Boot Integration documentation
71158
- Quick Start Guide with complete code examples
72159
- Configuration Reference for all `aether.datafixers.*` properties

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ inspired by Minecraft's DataFixer Upper (DFU), with a focus on **simplicity**, *
1010

1111
---
1212

13-
## ✨ Features (v0.3.0)
13+
## ✨ Features (v0.4.0)
1414

1515
-**Schema-Based Versioning** — Define data types per version with `Schema` and `TypeRegistry`
1616
-**Forward Patching** — Apply `DataFix` instances sequentially to migrate data across versions
1717
-**Format-Agnostic** — Work with any serialization format via `Dynamic<T>` and `DynamicOps<T>`
18+
-**Multi-Format Support** — JSON (Gson, Jackson), YAML (SnakeYAML, Jackson), TOML, and XML
1819
-**Codec System** — Bidirectional transformation between typed Java objects and dynamic representations
1920
-**Type Safety** — Strong typing with `TypeReference` identifiers for data routing
2021
-**Testkit** — Fluent test data builders, custom assertions, and test harnesses for DataFix testing
@@ -32,7 +33,7 @@ inspired by Minecraft's DataFixer Upper (DFU), with a focus on **simplicity**, *
3233

3334
- **aether-datafixers-api** — Core interfaces and API contracts (no implementation logic)
3435
- **aether-datafixers-core** — Default implementations of the API interfaces
35-
- **aether-datafixers-codec**Codec implementations for serialization formats
36+
- **aether-datafixers-codec**Multi-format codec implementations (JSON, YAML, TOML, XML)
3637
- **aether-datafixers-testkit** — Testing utilities for DataFix, Schema, and migration testing
3738
- **aether-datafixers-cli** — Command-line interface for data migration and validation
3839
- **aether-datafixers-schema-tools** — Schema analysis, validation, diffing, and introspection
@@ -421,7 +422,7 @@ public class GameService {
421422
aether:
422423
datafixers:
423424
enabled: true # Enable/disable auto-config
424-
default-format: gson # gson | jackson
425+
default-format: gson # gson | jackson | jackson_yaml | snakeyaml | jackson_toml | jackson_xml
425426
default-current-version: 200 # Fallback version
426427
domains:
427428
game:
@@ -555,19 +556,19 @@ mvn test
555556
- **High-performance APIs** — `Rules.batch()` and single-pass conditional transforms
556557
- **Performance optimizations** — Path caching, optimized fix registry, reduced allocations
557558

558-
- **v0.3.0** (current)
559+
- **v0.3.0**
559560
- **CLI module** — Migrate files from the command line with batch processing and reports
560561
- **Schema Tools module** — Schema diffing, migration analysis, validation, and introspection
561562
- **Fix coverage analysis** — Detect schema changes without corresponding DataFixes
562563
- **Convention checking** — Enforce naming conventions for types, fields, and classes
563564

564-
- **v0.4.0** (next)
565+
- **v0.4.0** (current)
565566
- **Spring Boot Starter** — Auto-configuration, MigrationService with fluent API
566567
- **Actuator integration** — Health indicator, info contributor, custom endpoint, Micrometer metrics
567568
- **Multi-domain support** — Multiple DataFixers with @Qualifier annotations
568-
- **DynamicOps auto-configuration** — Conditional GsonOps/JacksonOps beans
569-
- **Extra ops modules** — Optional YAML/TOML support (format adapters)
570-
- **Debug utilities** — Pretty printers / tree diff for Dynamic structures (dev-facing)
569+
- **DynamicOps auto-configuration** — Conditional beans for all supported formats
570+
- **Multi-format DynamicOps** — YAML (SnakeYAML, Jackson), TOML (Jackson), XML (Jackson)
571+
- **Package restructuring** — Format-first package organization (`codec.json.gson`, `codec.yaml.jackson`, etc.)
571572

572573
- **v0.5.0** (API freeze candidate)
573574
- **API stabilization pass** — Naming/packaging cleanup + deprecations completed

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/AetherCli.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
* aether-cli info --bootstrap com.example.MyBootstrap
5454
* }</pre>
5555
*
56-
* @author Erik Pfoertner
56+
* @author Erik Pförtner
5757
* @since 0.3.0
5858
*/
5959
@Command(

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/bootstrap/BootstrapLoadException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* Exception thrown when loading a {@link de.splatgames.aether.datafixers.api.bootstrap.DataFixerBootstrap}
2727
* implementation fails.
2828
*
29-
* @author Erik Pfoertner
29+
* @author Erik Pförtner
3030
* @since 0.3.0
3131
*/
3232
public class BootstrapLoadException extends RuntimeException {

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/bootstrap/BootstrapLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
* }
6262
* }</pre>
6363
*
64-
* @author Erik Pfoertner
64+
* @author Erik Pförtner
6565
* @see DataFixerBootstrap
6666
* @see BootstrapLoadException
6767
* @see java.util.ServiceLoader

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/command/InfoCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
* <li>{@code 1} - Error loading bootstrap or missing required option</li>
5959
* </ul>
6060
*
61-
* @author Erik Pfoertner
61+
* @author Erik Pförtner
6262
* @see de.splatgames.aether.datafixers.cli.AetherCli
6363
* @see de.splatgames.aether.datafixers.cli.format.FormatRegistry
6464
* @since 0.3.0

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/command/MigrateCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
* <li><b>Output file specified:</b> Result is written to the specified file or directory</li>
8787
* </ul>
8888
*
89-
* @author Erik Pfoertner
89+
* @author Erik Pförtner
9090
* @see de.splatgames.aether.datafixers.cli.AetherCli
9191
* @see ValidateCommand
9292
* @since 0.3.0

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/command/ValidateCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
* <li>{@code ERROR: filename - message} - File could not be validated</li>
7474
* </ul>
7575
*
76-
* @author Erik Pfoertner
76+
* @author Erik Pförtner
7777
* @see de.splatgames.aether.datafixers.cli.AetherCli
7878
* @see MigrateCommand
7979
* @since 0.3.0

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/format/FormatHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
* <p>Register in {@code META-INF/services/de.splatgames.aether.datafixers.cli.format.FormatHandler}</p>
6868
*
6969
* @param <T> the underlying data representation type
70-
* @author Erik Pfoertner
70+
* @author Erik Pförtner
7171
* @since 0.3.0
7272
*/
7373
public interface FormatHandler<T> {

aether-datafixers-cli/src/main/java/de/splatgames/aether/datafixers/cli/format/FormatParseException.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
/**
2626
* Exception thrown when parsing input data fails.
2727
*
28-
* @author Erik Pfoertner
28+
* @author Erik Pförtner
2929
* @since 0.3.0
3030
*/
3131
public class FormatParseException extends RuntimeException {

0 commit comments

Comments
 (0)