Merge pull request #918 from aaronlehmann/json-spec
Update JSON spec to point out escaping of <, >, &
This commit is contained in:
commit
b78a858b5d
@ -17,6 +17,10 @@ To provide consistent content hashing of JSON objects throughout Docker
|
|||||||
Distribution APIs, the specification defines a canonical JSON format. Adopting
|
Distribution APIs, the specification defines a canonical JSON format. Adopting
|
||||||
such a canonicalization also aids in caching JSON responses.
|
such a canonicalization also aids in caching JSON responses.
|
||||||
|
|
||||||
|
Note that protocols should not be designed to depend on identical JSON being
|
||||||
|
generated across different versions or clients. The canonicalization rules are
|
||||||
|
merely useful for caching and consistency.
|
||||||
|
|
||||||
## Rules
|
## Rules
|
||||||
|
|
||||||
Compliant JSON should conform to the following rules:
|
Compliant JSON should conform to the following rules:
|
||||||
@ -28,6 +32,8 @@ Compliant JSON should conform to the following rules:
|
|||||||
keys shall always appear in lexically sorted order.
|
keys shall always appear in lexically sorted order.
|
||||||
4. All whitespace between tokens should be removed.
|
4. All whitespace between tokens should be removed.
|
||||||
5. No "trailing commas" are allowed in object or array definitions.
|
5. No "trailing commas" are allowed in object or array definitions.
|
||||||
|
6. The angle brackets "<" and ">" are escaped to "\u003c" and "\u003e".
|
||||||
|
Ampersand "&" is escaped to "\u0026".
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user