EventStore / EventStoreDB-Client-Java

Official Asynchronous Java 8+ Client Library for EventStoreDB 20.6+
https://eventstore.com
Apache License 2.0
61 stars 19 forks source link

Expose building a JSON payload event with raw bytes in the EventData class #257

Closed YoEight closed 7 months ago

YoEight commented 7 months ago
Hey @OliverJurkschat, 

Something is missing indeed but from our side, an oversight to be precise. We deprecated relying on JsonMapper on any public API, like the EventDataBuilder you mentioned. 

The appropriate method is available if you look at `EventDataBuilder` class directly: https://eventstore.github.io/EventStoreDB-Client-Java/com/eventstore/dbclient/EventDataBuilder.html#json(java.lang.String,byte%5B%5D)

With this method, because you can provide the raw bytes yourself, you can use what ever you like to build your JSON. We forgot to expose that method in the `EventData` class.

Originally posted by @YoEight in https://github.com/EventStore/EventStoreDB-Client-Java/issues/256#issuecomment-1843067390