I am looking at making a rather minor change to the AtomPub interface that will be a breaking change but it would give better alignment with the Atom protocol.
Right now when you post to a stream you post
[
{
"eventId": "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4",
"eventType": "event-type",
"data": { "a": "1" }
}
]
This is not 100% correct from an atom perspective but it allows you to post metadata/data as well as multiple events in a single batch.
The change would be that if you post with a content-type of application/json we will assume the body is actually the single event you want to post to the stream as application/json which is closer to atom semantics. If you want to post multiple events or events with metadata the existing mechanism will still exist but would require the content type of vnd.eventstore.eventbatch.
Along with this since there would no longer be a separately typed “eventId” we would be adding a header ES-EventId. If you post with this header set we will use it for idempotency. If you post without this header set the server will generate a unique id for you and redirect your post to say /streams/mystream/incoming/{guid} which would be an idempotent uri that you can continue using.
From a client perspective this is a breaking change however it should be relatively easy to resolve as it would just be changing the content-type of the post. Before making the change we wanted to hear what people in the community thought about it.
Cheers,
Greg