Replies: 1 comment
-
Corresponding PR: #87 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 🙌
Beta Was this translation helpful? Give feedback.
All reactions