Create event using .NET client of JSON type

Is it possible to create event using .NET api of JSON type

Here is a list events created by EventStore of JSON type and created by me of no type

http://prntscr.com/2dq6xi

I can see the body of events via HTTP api for JSON type only

http://prntscr.com/2dq7hm

And no body for no type

http://prntscr.com/2dq807

However as you can see it has a valid JSON payload

http://prntscr.com/2dq95p

Is the ijson flag set?

I’m using Event Store 2.0.1
Where can I set that flag? Are you talking about “data_content_type” ?

From the .NET client API the constructor of EventData looks like this:

public EventData(Guid eventId,
string type, bool isJson,
byte[] data, byte[] metadata)

Setting isJson to true will do what you’re after, I think. It’s exposed in the protobufs as an enumeration (iirc) or maybe an integer to allow for future expansion.

Cheers,

James

Oh thanks,
I had it disabled, thought it doesn’t work correctly.

But it does work for Binary and Json types. However when I introduce new custom type lat’s say 2, it still will read event data with binary flag :slight_smile:

Anyway thx fro help.

Yes the other values are undefined. We dropped it in for forward compatibility at wire level for supporting things like bson etc

There is different problem regarding content type.
In protobuf I always receive content type as Binary regardless to what was originally set. This is true for both data and metadata

You are saying if you set isjson you get it back as binary?

exactly

hmm I will try to reproduce

Are there any progress on this?

I can still see this issue with RC3,
Please could anyone take a look?

I also got complains from one user of jvm client.