nitrictech / nitric

Nitric is a multi-language framework for cloud applications with infrastructure from code.
https://nitric.io
Apache License 2.0
1.11k stars 49 forks source link

improve messaging payload DX #518

Closed jyecusch closed 8 months ago

jyecusch commented 1 year ago

Current DX requires an object/struct that contains a payload, id and type. While this was initially intended to provide a lightweight cloudevents-like experience and encourage unique IDs for idempotency it likely imposes too much oppinion around messages.

Additionally, SDKs provide methods for deserializing messages e.g. ctx.req.json() which were intended to deserialize the payload, but instead deserialize the entire message, with payload as a property. This behaviour is unintuitive and needs to be updated to match the original intention.

jyecusch commented 8 months ago

Fixed in nitric v1.0.0