Skip to content

Conversation

@ametke
Copy link
Collaborator

@ametke ametke commented Jan 6, 2026

TL;DR

Add serialization support for domain API types to enable persistence and state restoration.

What changed?

  • Added SerialisableDomainApi interface that domain APIs can implement to provide serialization support
  • Created DomainApiSerialisersModuleBuilder with a DSL for registering serializers for hurdles, notifications, and responses
  • Added test fixtures for verifying serialization support
  • Updated the example PizzaDomainApi to implement serialization support
  • Added kotlinx-serialization-json dependency for tests

How to test?

  1. Run the new tests in DomainApiSerialisersModuleBuilderTest to verify the serialization functionality
  2. Create a domain API that implements SerialisableDomainApi and register serializers for your types
  3. Use the verifySerialisationSupport utility to test your serialization configuration

Why make this change?

Domain APIs need serialization support to enable:

  • Persisting state across process deaths
  • Restoring navigation state
  • Communicating between processes or over network boundaries
  • Storing domain API state in databases or caches

This change provides a standardized way for domain APIs to declare their serialization capabilities and for frameworks to utilize them.

Copy link
Collaborator Author

ametke commented Jan 6, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ametke ametke marked this pull request as ready for review January 6, 2026 16:29
@ametke ametke requested a review from a team as a code owner January 6, 2026 16:29
@ametke ametke merged commit 5bc844d into main Jan 6, 2026
4 checks passed
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.

3 participants