You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, associative arrays are serialized as arrays in the payload. I'd like to propose changing this behavior to serialize them as objects instead.
Motivation
In many other languages and specifications (like Swagger and JSON schema), associative arrays naturally translate to (unstructured) objects. This approach would also give us a clear distinction between maps (associative arrays) and lists (sequential arrays), making the serialized data more semantically correct.
Other benefits
This change would eliminate the need to recursively iterate through the payload to cast associative arrays to objects when validating the serialized payload against a JSON schema, which can be quite heavy performance-wise.
The change would make EventSauce's serialization more aligned with widely-used standards while also making it suitable for downstream validation.
I'd love to hear your thoughts on this, @frankdejonge 🙌
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Currently, associative arrays are serialized as arrays in the payload. I'd like to propose changing this behavior to serialize them as objects instead.
Motivation
In many other languages and specifications (like Swagger and JSON schema), associative arrays naturally translate to (unstructured) objects. This approach would also give us a clear distinction between maps (associative arrays) and lists (sequential arrays), making the serialized data more semantically correct.
Other benefits
This change would eliminate the need to recursively iterate through the payload to cast associative arrays to objects when validating the serialized payload against a JSON schema, which can be quite heavy performance-wise.
The change would make EventSauce's serialization more aligned with widely-used standards while also making it suitable for downstream validation.
I'd love to hear your thoughts on this, @frankdejonge 🙌
All reactions