Skip to content

Commit

Permalink
fix for not encoding json as default (#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
sdyura committed Aug 23, 2024
1 parent fa60342 commit b05a52e
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
*/
@Provider
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.WILDCARD)
// https://datatracker.ietf.org/doc/html/rfc8949
@Produces({ "application/cbor", MediaType.WILDCARD })
public class JacksonCBORProvider
extends ProviderBase<JacksonCBORProvider,
ObjectMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*/
@Provider
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.WILDCARD)
//https://datatracker.ietf.org/doc/html/rfc8949
@Produces({ "application/cbor", MediaType.WILDCARD })
public class JacksonJaxbCBORProvider extends JacksonCBORProvider {
/**
* Default annotation sets to use, if not explicitly defined during
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
@Provider
@Consumes(MediaType.WILDCARD) // NOTE: required to support "non-standard" JSON variants
@Produces(MediaType.WILDCARD)
@Produces({MediaType.APPLICATION_JSON, "text/json", MediaType.WILDCARD})
public class JacksonJaxbJsonProvider extends JacksonJsonProvider {
/**
* Default annotation sets to use, if not explicitly defined during
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
*/
@Provider
@Consumes(MediaType.WILDCARD) // NOTE: required to support "non-standard" JSON variants
@Produces(MediaType.WILDCARD)
@Produces({MediaType.APPLICATION_JSON, "text/json", MediaType.WILDCARD})
public class JacksonJsonProvider
extends ProviderBase<JacksonJsonProvider,
ObjectMapper,
Expand Down
6 changes: 6 additions & 0 deletions release-notes/CREDITS-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@ Steven Schlansker (@stevenschlansker)

* Contributed #170: Add `JaxRsFeature.READ_FULL_STREAM` to consume all content
(2.15.0)

Yura (@sdyura)

* Contributed #193: `JacksonJaxbJsonProvider` has @Produces(MediaType.WILDCARD) and yet
hasMatchingMediaType(MediaType.WILDCARD) return false
(2.18.0)
3 changes: 3 additions & 0 deletions release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ Sub-modules:

#192: Bring back code to support JAXRS v1 (revert #134 for 2.18)
(contributed by @pjfanning)
#193: `JacksonJaxbJsonProvider` has @Produces(MediaType.WILDCARD) and yet
hasMatchingMediaType(MediaType.WILDCARD) return false
(contributed by Yura)
* Woodstox dependency now 7.0.0

2.17.2 (05-Jul-2024)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
*/
@Provider
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.WILDCARD)
@Produces({ MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.WILDCARD })
public class JacksonJaxbXMLProvider extends JacksonXMLProvider {
/**
* Default annotation sets to use, if not explicitly defined during
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
*/
@Provider
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.WILDCARD)
@Produces({ MediaType.APPLICATION_XML, MediaType.TEXT_XML, MediaType.WILDCARD })
public class JacksonXMLProvider
extends ProviderBase<JacksonXMLProvider,
XmlMapper,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
*/
@Provider
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.WILDCARD)
// As per https://www.rfc-editor.org/rfc/rfc9512.html
@Produces({ "application/yaml", MediaType.WILDCARD })
public class JacksonJaxbYAMLProvider extends JacksonYAMLProvider {
/**
* Default annotation sets to use, if not explicitly defined during
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
*/
@Provider
@Consumes(MediaType.WILDCARD)
@Produces(MediaType.WILDCARD)
//As per https://www.rfc-editor.org/rfc/rfc9512.html
@Produces({ "application/yaml", MediaType.WILDCARD })
public class JacksonYAMLProvider
extends ProviderBase<JacksonYAMLProvider,
YAMLMapper,
Expand Down

0 comments on commit b05a52e

Please sign in to comment.