Changes to Atom breaking comments?

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

For comment here are the changes discussed (they are breaking)

https://github.com/EventStore/EventStore/pull/113

From a client perspective (and we are considering putting this in 3.0) the only difference of the atom protocol would be the setting of a content type on the post.

Would love to hear feedback on this.

Cheers,

Greg

For the benefit of anyone building from source, builds from the current dev branch onwards have these changes in them.

Regards,

James

The documentation has also been updated if you want to look through how this works https://github.com/eventstore/eventstore/wiki/Writing-to-a-Stream-%28HTTP%29

Cheers,

Greg