Skip to content

Commit c05acf7

Browse files
authored
Merge pull request #1249 from sudo-bmitch/pr-json
Clarify that canonical JSON is not a requirement
2 parents 50b35ce + aca17c0 commit c05acf7

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

considerations.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,17 @@ Implementations processing content SHOULD NOT generate an error if they encounte
2121
- To allow efficient storage, implementations serializing content for blobs SHOULD use a canonical serialization.
2222
- This increases the chance that different implementations can push the same semantic content to the store without creating redundant blobs.
2323

24-
### JSON
24+
## JSON
2525

26-
[JSON][JSON] content SHOULD be serialized as [canonical JSON][canonical-json].
2726
Of the [OCI Image Format Specification media types](media-types.md), all the types ending in `+json` contain JSON content.
28-
Implementations:
27+
All [JSON][JSON] content MUST follow the I-JSON limitations in [RFC 7493][rfc7493]:
2928

30-
- [Go][Go]: [github.com/docker/go][docker-go], which claims to implement [canonical JSON][canonical-json] except for Unicode normalization.
29+
- The encoding MUST be [UTF-8][rfc3629]
30+
- Numbers SHOULD be limited to IEEE 754 double precision
31+
- Objects MUST NOT contain duplicate names
32+
33+
The order of entries in JSON objects is not significant.
34+
Implementations MAY implement Canonical JSON documented in [RFC 8785][rfc8785].
3135

3236
## EBNF
3337

@@ -137,11 +141,11 @@ The above can be converted into the following regular expression:
137141
[a-z]+(?:/[a-z]+)*
138142
```
139143

140-
[canonical-json]: https://wiki.laptop.org/go/Canonical_JSON
141144
[distribution-spec]: https://github.com/opencontainers/distribution-spec/blob/main/spec.md
142-
[docker-go]: https://github.com/docker/go/
143145
[ebnf]: https://en.wikipedia.org/wiki/Extended_Backus%E2%80%93Naur_form
144-
[Go]: https://golang.org/
145146
[JSON]: https://json.org/
147+
[rfc3629]: https://datatracker.ietf.org/doc/html/rfc3629
148+
[rfc7493]: https://datatracker.ietf.org/doc/html/rfc7493
149+
[rfc8785]: https://datatracker.ietf.org/doc/html/rfc8785
146150
[runtime-spec]: https://github.com/opencontainers/runtime-spec/blob/main/spec.md
147151
[xmlebnf]: https://www.w3.org/TR/REC-xml/#sec-notation

0 commit comments

Comments
 (0)