Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt Jackson 2.15 #5409

Merged
merged 1 commit into from
Sep 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ Javassist Version 3.29.2-GA
* Project: http://www.javassist.org/
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.

Jackson JAX-RS Providers Version 2.14.1
Jackson JAX-RS Providers Version 2.15.2
* License: Apache License, 2.0
* Project: https://github.com/FasterXML/jackson-jaxrs-providers
* Copyright: (c) 2009-2022 FasterXML, LLC. All rights reserved unless otherwise indicated.
* Copyright: (c) 2009-2023 FasterXML, LLC. All rights reserved unless otherwise indicated.

jQuery v1.12.4
* License: jquery.org/license
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -26,6 +26,18 @@
@PropertiesClass
public final class MessageProperties {

/**
* If set to {@code true}, {@code DeflateEncoder deflate encoding interceptor} will use non-standard version
* of the deflate content encoding, skipping the zlib wrapper. Unfortunately, deflate encoding
* implementations in some products use this non-compliant version, hence the switch.
* <p />
* The default value is {@code false}.
* <p />
* The name of the configuration property is <code>{@value}</code>.
*/
public static final String DEFLATE_WITHOUT_ZLIB = "jersey.config.deflate.nozlib";


/**
* If set to {@code true} then XML root element tag name for collections will
* be derived from {@link javax.xml.bind.annotation.XmlRootElement @XmlRootElement}
Expand Down Expand Up @@ -80,15 +92,22 @@ public final class MessageProperties {
public static final int IO_DEFAULT_BUFFER_SIZE = 8192;

/**
* If set to {@code true}, {@code DeflateEncoder deflate encoding interceptor} will use non-standard version
* of the deflate content encoding, skipping the zlib wrapper. Unfortunately, deflate encoding
* implementations in some products use this non-compliant version, hence the switch.
* <p />
* The default value is {@code false}.
* <p />
* The name of the configuration property is <code>{@value}</code>.
* <p>
* Integer value used to override maximum number of string length during the JSON processing the JSON provider accepts.
* </p>
* <p>
* The default value is not set and the JSON provider default maximum value is used.
* </p>
* <p>
* If supported by Jackson provider, the default value can differ for each Jackson version. For instance,
* Jackson 14 does not support this setting and the default value is {@link Integer#MAX_VALUE}, Jackson 15.0
* has the default value 5_000_000, Jackson 15.2 has the default value 20_000_000.
* </p>
*
* @since 2.41
*/
public static final String DEFLATE_WITHOUT_ZLIB = "jersey.config.deflate.nozlib";
public static String JSON_MAX_STRING_LENGTH = "jersey.config.json.string.length";


/**
* If set to {@code true}, {@link javax.ws.rs.ext.MessageBodyReader MessageBodyReaders} and
Expand Down
112 changes: 112 additions & 0 deletions docs/src/main/docbook/appendix-properties.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,118 @@
</tbody>
</tgroup>
</table>
</section>
<section xml:id="appendix-properties-message">
<title>Jersey configuration properties for message &amp; entity processing</title>

<para>
List of client configuration properties that can be found in &jersey.message.MessageProperties; class.
</para>

<table>
<title>List of Apache HTTP client configuration properties</title>
<tgroup cols="3">
<thead>
<row>
<entry>Constant</entry>
<entry>Value</entry>
<entry>Description</entry>
</row>
</thead>
<tbody>
<row>
<entry>&jersey.message.MessageProperties.DEFLATE_WITHOUT_ZLIB;</entry>
<entry><literal>jersey.config.deflate.nozlib</literal></entry>
<entry>
<para>
If set to &lit.true;, <literal>DeflateEncoder deflate encoding interceptor</literal> will use non-standard version
of the deflate content encoding, skipping the zlib wrapper. Unfortunately, deflate encoding
implementations in some products use this non-compliant version, hence the switch.
</para>
<para>
The default value is &lit.false;.
</para>
</entry>
</row>
<row>
<entry>&jersey.message.MessageProperties.IO_BUFFER_SIZE;</entry>
<entry><literal>jersey.config.io.bufferSize</literal></entry>
<entry>
<para>
Value of the property indicates the buffer size to be used for I/O operations
on byte and character streams. The property value is expected to be a positive
integer otherwise it will be ignored.
</para>
<para>
The default value is value of &jersey.message.MessageProperties.IO_DEFAULT_BUFFER_SIZE;.
</para>
</entry>
</row>
<row>
<entry>&jersey.message.MessageProperties.JAXB_PROCESS_XML_ROOT_ELEMENT;</entry>
<entry><literal>jersey.config.jaxb.collections.processXmlRootElement</literal></entry>
<entry>
<para>
If set to &lit.true; then XML root element tag name for collections will
be derived from <literal>javax.xml.bind.annotation.XmlRootElement</literal>
annotation value and won't be de-capitalized.
</para>
<para>
The default value is &lit.false;.
</para>
</entry>
</row>
<row>
<entry>&jersey.message.MessageProperties.JSON_MAX_STRING_LENGTH;</entry>
<entry><literal>jersey.config.json.string.length</literal></entry>
<entry>
<para>
The default value is not set and the JSON provider default maximum value is used.
</para>
<para>
If supported by Jackson provider, the default value can differ for each Jackson version. For instance,
Jackson 14 does not support this setting and the default value is <literal>Integer#MAX_VALUE</literal>,
Jackson 15.0 has the default value 5_000_000, Jackson 15.2 has the default value 20_000_000.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Jackson versions are 2.14 and 2.15 - there is no 14 or 15. The 20m limit was brought in in Jackson 2.15.1.

See https://github.com/FasterXML/jackson-core/blob/2.16/release-notes/VERSION-2.x

</para>
</entry>
</row>
<row>
<entry>&jersey.message.MessageProperties.XML_SECURITY_DISABLE;</entry>
<entry><literal>jersey.config.xml.security.disable</literal></entry>
<entry>
<para>
If set to &lit.true; XML security features when parsing XML documents will be
disabled.
</para>
<para>
The default value is &lit.false;.
</para>
</entry>
</row>
<row>
<entry>&jersey.message.MessageProperties.XML_FORMAT_OUTPUT;</entry>
<entry><literal>jersey.config.xml.formatOutput</literal></entry>
<entry>
<para>
If set to &lit.true; indicates that produced XML output should be formatted
if possible.
</para>
<para>
A XML message entity written by a &jaxrs.ext.MessageBodyWriter;
may be formatted for the purposes of human readability provided the respective
&jaxrs.ext.MessageBodyWriter; supports XML output formatting. All JAXB-based message
body writers support this property.
</para>
<para>
The default value is &lit.false;.
</para>
</entry>
</row>
</tbody>
</tgroup>
</table>


</section>
<section xml:id="appendix-properties-client-apache">
<title>Apache HTTP client configuration properties</title>
Expand Down
7 changes: 7 additions & 0 deletions docs/src/main/docbook/jersey.ent
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,13 @@
<!ENTITY jersey.media.multipart.StreamDataBodyPart "<link xlink:href='&jersey.javadoc.uri.prefix;/media/multipart/file/StreamDataBodyPart.html'>StreamDataBodyPart</link>" >
<!ENTITY jersey.message.MessageBodyWorkers "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageBodyWorkers.html'>MessageBodyWorkers</link>">
<!ENTITY jersey.message.MessageProperties "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html'>MessageProperties</link>">
<!ENTITY jersey.message.MessageProperties.DEFLATE_WITHOUT_ZLIB "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#DEFLATE_WITHOUT_ZLIB'>MessageProperties.DEFLATE_WITHOUT_ZLIB</link>">
<!ENTITY jersey.message.MessageProperties.IO_BUFFER_SIZE "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#IO_BUFFER_SIZE'>MessageProperties.IO_BUFFER_SIZE</link>">
<!ENTITY jersey.message.MessageProperties.IO_DEFAULT_BUFFER_SIZE "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#IO_DEFAULT_BUFFER_SIZE'>MessageProperties.IO_DEFAULT_BUFFER_SIZE</link>">
<!ENTITY jersey.message.MessageProperties.JAXB_PROCESS_XML_ROOT_ELEMENT "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#JAXB_PROCESS_XML_ROOT_ELEMENT'>MessageProperties.JAXB_PROCESS_XML_ROOT_ELEMENT</link>">
<!ENTITY jersey.message.MessageProperties.JSON_MAX_STRING_LENGTH "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#JSON_MAX_STRING_LENGTH'>MessageProperties.JSON_MAX_STRING_LENGTH</link>">
<!ENTITY jersey.message.MessageProperties.XML_SECURITY_DISABLE "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#XML_SECURITY_DISABLE'>MessageProperties.XML_SECURITY_DISABLE</link>">
<!ENTITY jersey.message.MessageProperties.XML_FORMAT_OUTPUT "<link xlink:href='&jersey.javadoc.uri.prefix;/message/MessageProperties.html#XML_FORMAT_OUTPUT'>MessageProperties.XML_FORMAT_OUTPUT</link>">
<!ENTITY jersey.message.filtering.AbstractEntityProcessor "<link xlink:href='&jersey.javadoc.uri.prefix;/message/filtering/spi/AbstractEntityProcessor.html'>AbstractEntityProcessor</link>">
<!ENTITY jersey.message.filtering.AbstractObjectProvider "<link xlink:href='&jersey.javadoc.uri.prefix;/message/filtering/spi/AbstractObjectProvider.html'>AbstractObjectProvider</link>">
<!ENTITY jersey.message.filtering.EntityFiltering "<link xlink:href='&jersey.javadoc.uri.prefix;/message/filtering/EntityFiltering.html'>@EntityFiltering</link>">
Expand Down
19 changes: 18 additions & 1 deletion docs/src/main/docbook/media.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" standalone="no"?>
<!--

Copyright (c) 2012, 2022 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -1162,7 +1162,15 @@ public class JsonbContextResolver implements ContextResolver&lt;Jsonb&gt; {
</para>
</formalpara>
</section>
</section>
<section xml:id="json.configuration">
<title>Properties for configuring JSON providers</title>

<para>
Apart from using &lit.jaxrs.ext.ContextResolver; for configuring directly the specific JSON provider classes,
Jersey supports additional configuration properties prefixed by <literal>JSON</literal> that are available in
<xref linkend="appendix-properties-message">the appendix.</xref>
</para>
</section>
</section>

Expand Down Expand Up @@ -1489,6 +1497,15 @@ final ResourceConfig config = new ResourceConfig()
));</programlisting>
</example>
</section>
<section xml:id="jaxb.configuration">
<title>Properties for configuring XML providers</title>

<para>
Apart from using &lit.jaxrs.ext.ContextResolver; for configuring directly the specific JSON provider classes,
Jersey supports additional configuration properties prefixed by <literal>JAXB</literal> and <literal>XML</literal>
that are available in <xref linkend="appendix-properties-message">the appendix.</xref>
</para>
</section>
</section>

<section xml:id="multipart">
Expand Down
20 changes: 16 additions & 4 deletions docs/src/main/docbook/migration.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!--

Copyright (c) 2012, 2021 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2023 Oracle and/or its affiliates. All rights reserved.

This program and the accompanying materials are made available under the
terms of the Eclipse Public License v. 2.0, which is available at
Expand All @@ -28,6 +28,18 @@
xml:id="migration">
<title>Migration Guide</title>

<section xml:id="mig-2.40">
<title>Migrating from Jersey 2.40 to 2.41</title>
<section xml:id="mig-2.40-breaking-changes">
<title>Changes in Jackson</title>
<para>
Jersey 2.41 starts to support Jackson 15 which comes with default limitations for the length of parsed text,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

again, no Jackson v15 has ever been released

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, it is 2.15

numbers, and nesting depth. Jersey keeps the Jackson default value, but it allows to override the maximum
length of parsed text using the &jersey.message.MessageProperties.JSON_MAX_STRING_LENGTH; property if needed.
</para>
</section>
</section>

<section xml:id="mig-2.38">
<title>Migrating from Jersey 2.37 to 2.38</title>
<section xml:id="mig-2.38-breaking-changes">
Expand All @@ -46,13 +58,13 @@
<section xml:id="mig-2.30-breaking-changes">
<title>Breaking Changes</title>
<para>
Versions 2.30+ do not introduce nothing breaking, however version 2.29.1 has a major change which means
Versions 2.30+ do not introduce anything breaking, however version 2.29.1 has a major change which means
migration of Jersey to Jakarta EE (8) platform thus all inner dependencies to APIs are migrated to
jakarta EE maven coordinates. This also means that all dependencies which were taken from JDK as such
(like JAXB etc) are now external for JDK 1.8 (but for JDK 11+ they are external even in their Java EE form).
(like JAXB etc.) are now external for JDK 1.8 (but for JDK 11+ they are external even in their Java EE form).
So, for those who will migrate to versions of Jersey 2.29.1 or 2.30+ , a massive extension of dependencies being
downloaded for the project build will occur.
Also there is extended support of JDKs - maximum compatibility with JDK 15 (including previous JDKs).
Also, there is extended support of JDKs - maximum compatibility with JDK 15 (including previous JDKs).
And other major improvements and fixes which are described in details in release notes below.
</para>
</section>
Expand Down
4 changes: 2 additions & 2 deletions examples/NOTICE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ Javassist Version 3.29.2-GA
* Project: http://www.javassist.org/
* Copyright (C) 1999- Shigeru Chiba. All Rights Reserved.

Jackson JAX-RS Providers Version 2.14.1
Jackson JAX-RS Providers Version 2.15.2
* License: Apache License, 2.0
* Project: https://github.com/FasterXML/jackson-jaxrs-providers
* Copyright: (c) 2009-2011 FasterXML, LLC. All rights reserved unless otherwise indicated.
* Copyright: (c) 2009-2023 FasterXML, LLC. All rights reserved unless otherwise indicated.

jQuery v1.12.4
* License: jquery.org/license
Expand Down
Loading