Skip to content

Add serialization for type metadata and registry - #363

Merged
waynemwashuma merged 4 commits into
wimaengine:devfrom
waynemwashuma:serialize-type-info
Sep 5, 2026
Merged

waynemwashuma merged 4 commits into
wimaengine:devfrom
waynemwashuma:serialize-type-info

Conversation

@waynemwashuma

Copy link
Copy Markdown
Collaborator

Objective

Introduces serialization, deserialization, and validation support for reflection type metadata and the TypeRegistry.

Solution

Each supported TypeInfo subtype now defines its serialized representation and handles converting to and from that representation.

Changes Made

The following changes were introduced:

  • Added serialize, deserialize, and validateSerial methods for all type info.
  • Added TypeEntry dispatch logic for supported TypeInfo subtypes.
  • Added TypeRegistry serialization, deserialization, and validation.
  • Added support for deserializing into existing output instances.

Why This Approach

This solution was chosen because:

  • The kind discriminator makes serialized type information straightforward to validate and reconstruct.
  • Serialization remains colocated with each type metadata implementation.
  • Output parameters allow existing instances to be reused during deserialization.
  • Registry-level serialization makes complete reflection schemas portable and persistable.

Showcase

N/A

Migration Guide

No migration required.

Checklist

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@waynemwashuma waynemwashuma self-assigned this Sep 5, 2026
@waynemwashuma waynemwashuma added type:enhancement New feature or request mod:reflect labels Sep 5, 2026
@waynemwashuma
waynemwashuma merged commit 54e1d1c into wimaengine:dev Sep 5, 2026
7 checks passed
@waynemwashuma
waynemwashuma deleted the serialize-type-info branch September 5, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:reflect type:enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant