spec: String type: "printable Unicode characters" and follow-on problems
Previous discussion started by @evankanderson here: https://github.com/cloudevents/spec/pull/456#issuecomment-507860941 and in the following comments. Also, here: https://github.com/cloudevents/spec/pull/471/files#r312744230 and here: https://github.com/cloudevents/spec/pull/482#issuecomment-520437625
The String type currently only allows “printable” Unicode characters.
There are multiple problems:
- As @evankanderson has pointed out, while “printable” is defined for ASCII, it isn’t clear what it means in Unicode.
- One may assume that space is not “printable” (but per ASCII, it is)
- We can’t use
Stringfor thedataattribute. The most obvious reason is that line breaks can’t be used, which is an issue for plain text, but also if we want to model JSON, XML or CSV asString.
String is used in three places:
- As a key for
Map. The “printable” requirement makes sense (and may be even to weak?) - As a value in regular attributes. The “printable” requirement makes sense, or we’d have to rework our HTTP transport a bit (as headers are terminated by a line break).
- As a value in
data. The requirement is too restrictive.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (6 by maintainers)
@cneijenhuis will #485 address your concern?
Created: https://github.com/cloudevents/spec/pull/484
@clemensv @cneijenhuis (et al), see what you think:
full set of changes based on my comment above: https://github.com/cloudevents/spec/compare/master...duglin:data
just spec.md: https://github.com/cloudevents/spec/compare/master...duglin:data?expand=1#diff-958e7270f96f5407d7d980f500805b1b