We have an issue in CNCF CloudEvents about maps not being permitted in application-properties. I remember weâve run up against that ourselves recently.
A few questions:
- Does anyone remember why that constraint was put in?
Risk that the target type system is to weak to express them and that boosting it up will make everything mroe more complicated.Â
E.g. HTTP headers are just string. To represent a map in a HTTP header you have 2 problems
1. Pick an encoding (json probably)
2. Find a way to distinguish maps from properties that are *intended* to be strings but look like maps.
2 is the hard part, unless you require that *every* CE property that is encoded as HTTP must be JSON encoded, and now you've lost "simple" interop with normal HTTP usage and people will go mad trying to understand why all these headers have bloody quotes around them. We're already seeing interop breakdowns and arguments over to-quote-or-not-to-quote issues because of confusion over whether a HTTP body is always JSON encoded. The spec makes it clear (I think) but the rules are already involved enough for bugs to creep in.
- Do existing implementations enforce the constraint?
Not enforce, but quite likely fail to inter-operate.
You don't need *me* to tellÂ you that :)