play-json icon indicating copy to clipboard operation
play-json copied to clipboard

RFC4627 is obsoleted

Open xuwei-k opened this issue 6 years ago • 1 comments

https://github.com/playframework/play-json/blob/3c9825bc06a9c3219a83c1f22c848bc2a6f945d5/play-json/shared/src/main/scala/play/api/libs/json/Json.scala#L35

This document replaces [RFC7159]. [RFC7159] obsoleted [RFC4627], which originally described JSON and registered the media type "application/json".

https://tools.ietf.org/html/rfc8259

xuwei-k avatar Dec 20 '17 03:12 xuwei-k

Using the heuristics in RFC4627 allows us to parse all JSON that is valid under RFC8259, since it detects and parses UTF-8 JSON, so I don't think this is a bug.

Note that the actual decoding is done automatically by Jackson right now, so changing the code to support only UTF-8 would probably be more complicated. We could improve the comment to clarify that this method of parsing supports encodings that would not be valid under RFC8259.

If we were to implement a new parser in a future version of play-json, RFC8259 provides a solid reason to simplify things by only supporting UTF-8, but I don't see any value in breaking existing behavior.

gmethvin avatar Dec 24 '17 05:12 gmethvin