Skip to content

feat: add client data model#6

Merged
cdavernas merged 2 commits intomainfrom
feat-add-client-data-model
Mar 13, 2026
Merged

feat: add client data model#6
cdavernas merged 2 commits intomainfrom
feat-add-client-data-model

Conversation

@cdavernas
Copy link
Copy Markdown
Member

This pull request introduces a new ClientDataModel class to the core library, updates serialization support, and adds corresponding unit tests. It also refines the immutability of the Version property in existing records and increments the project version. The most important changes are grouped below:

New Client Data Model Implementation:

  • Added the ClientDataModel record to represent client-maintained object data models, including versioning and surface state mapping. (src/A2UI.Core/ClientDataModel.cs)
  • Registered ClientDataModel for JSON serialization in JsonSerializationContext. (src/A2UI.Core/Serialization/Json/JsonSerializationContext.cs)

Testing Support:

  • Introduced unit tests for serialization/deserialization of ClientDataModel in ClientDataModelTests. (tests/A2UI.UnitTests/Cases/Core/ClientDataModelTests.cs)
  • Added a factory class for generating sample ClientDataModel instances in tests. (tests/A2UI.UnitTests/Services/ClientDataModelFactory.cs)

API Consistency and Versioning:

  • Changed the Version property in ClientSideEvent and Message records from set to init to enforce immutability. (src/A2UI.Core/ClientSideEvent.cs, src/A2UI.Core/Message.cs) [1] [2]
  • Incremented the project version prefix from 0.2.0 to 0.3.0 in A2UI.Core.csproj. (src/A2UI.Core/A2UI.Core.csproj)

@cdavernas cdavernas self-assigned this Mar 13, 2026
@cdavernas cdavernas requested a review from JBBianchi as a code owner March 13, 2026 11:26
@cdavernas cdavernas merged commit 1c0f345 into main Mar 13, 2026
1 check passed
@cdavernas cdavernas deleted the feat-add-client-data-model branch March 13, 2026 11:27
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.

1 participant