diff --git a/chapters/changes.tex b/chapters/changes.tex index 9c2d62d..1512bf8 100644 --- a/chapters/changes.tex +++ b/chapters/changes.tex @@ -5,6 +5,7 @@ \section{Changes Since 2.1 Public Review} \begin{itemize} \item Section \ref{executor_services}: Removed defaults for all environments not supporting the Java Concurrenty Utilities for Java EE API. \item Section \ref{jsonp}: Support for \code{JsonValue} and all its sub-types. + \item Section \ref{jsonb}: New section for JSON-B support. \end{itemize} \section{Changes Since 2.1 Early Draft} diff --git a/chapters/environment.tex b/chapters/environment.tex index 2999ad6..7a2b6c9 100644 --- a/chapters/environment.tex +++ b/chapters/environment.tex @@ -124,11 +124,19 @@ \subsection{Bean Validation} \subsection{Java API for JSON Processing} \label{jsonp} -In a product that supports the Java API for JSON Processing (JSON-P) \cite{jsonp}, implementations MUST support entity providers for \code{JsonValue} and all of its sub-types: -\code{JsonStructure}, \code{JsonObject}, \code{JsonArray}, \code{JsonString} and \code{JsonNumber}. Therefore, the standard set of entity providers from Section~\ref{standard_entity_providers} is extended to support these types in combinations with the \code{application/json} media type. +In a product that supports the Java API for JSON Processing (JSON-P) \cite{jsonp}, implementations MUST support entity providers for \code{JsonValue} and all of its sub-types: \code{JsonStructure}, \code{JsonObject}, \code{JsonArray}, \code{JsonString} and \code{JsonNumber}. Note that other types from the JSON-P API such as \code{JsonParser}, \code{JsonGenerator}, \code{JsonReader} and \code{JsonWriter} can also be integrated into JAX-RS applications using the entity providers for \code{InputStream} and \code{StreamingOutput}. + +\subsection{Java API for JSON Binding} +\label{jsonb} +In a product that supports the Java API for JSON Binding (JSON-B) \cite{jsonb}, +implementations MUST support entity providers for all Java types supported by JSON-B in combination with the \code{application/json} media type. + +Note that if JSON-B and JSON-P are both supported in the same environment, entity providers for JSON-B take precedence over those for JSON-P for all types except \code{JsonValue} and its sub-types. + + \subsection{Additional Requirements} \label{additional_reqs} diff --git a/chapters/providers.tex b/chapters/providers.tex index 67eaa83..7a51b3e 100644 --- a/chapters/providers.tex +++ b/chapters/providers.tex @@ -98,6 +98,8 @@ \subsection{Standard Entity Providers} \item[\code{java.lang.Boolean}, \code{java.lang.Character}, \code{java.lang.Number} \label{primitive_types}] Only for \code{text/plain}. Corresponding primitive types supported via boxing/unboxing conversion. \end{description} +Depending on the environment, the list of standard entity providers MUST also include those for media type \code{application/json}. For more information about these providers see Sections \ref{jsonp} and \ref{jsonb}. + When reading zero-length message entities all pre-packaged \MsgRead\ implementations, except the JAXB one and those for the (boxed) primitive types above, MUST create a corresponding Java object that represents zero-length data. The pre-packaged JAXB and the pre-packaged primitive type \MsgRead\ implementations MUST throw a \code{NoContentException} for zero-length message entities. When a \code{NoContentException} is thrown while reading a server request entity from a \MsgRead\, it MUST be translated by the server runtime into a \code{BadRequestException} wrapping the original \code{NoContentException} and re-thrown to be processed by any registered exception mappers. diff --git a/references.bib b/references.bib index c245e88..b620569 100644 --- a/references.bib +++ b/references.bib @@ -439,6 +439,15 @@ @techreport{jsonp Title = {{Java} {API} {for} {JSON} {Processing} {1.1}}, Type = {{JSR}}, Year = 2017} + +@techreport{jsonb, + Author = {Dmitry Kornilov}, + Institution = {JCP}, + Month = {July}, + Note = {See http://jcp.org/en/jsr/detail?id=367}, + Title = {{Java} {API} {for} {JSON} {Binding}}, + Type = {{JSR}}, + Year = 2017} @techreport{concurrencyee, Author = {Anthony Lai}, diff --git a/spec.pdf b/spec.pdf index ab8d846..33ba63f 100644 Binary files a/spec.pdf and b/spec.pdf differ