-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure that Server Jackson providers are not included in the REST Client
- Loading branch information
Showing
17 changed files
with
151 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
...ment/src/test/java/io/quarkus/rest/client/reactive/TestJacksonBasicMessageBodyReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package io.quarkus.rest.client.reactive; | ||
|
||
import javax.ws.rs.Consumes; | ||
|
||
import org.jboss.resteasy.reactive.server.jackson.JacksonBasicMessageBodyReader; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
@Consumes({ "application/json", "application/x-ndjson", "application/stream+json" }) | ||
public class TestJacksonBasicMessageBodyReader extends JacksonBasicMessageBodyReader { | ||
public TestJacksonBasicMessageBodyReader() { | ||
super(new ObjectMapper()); | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
...ment/src/test/java/io/quarkus/rest/client/reactive/TestJacksonBasicMessageBodyWriter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package io.quarkus.rest.client.reactive; | ||
|
||
import static org.jboss.resteasy.reactive.server.jackson.JacksonMessageBodyWriterUtil.doLegacyWrite; | ||
|
||
import java.io.IOException; | ||
import java.io.OutputStream; | ||
import java.lang.annotation.Annotation; | ||
import java.lang.reflect.Type; | ||
|
||
import javax.ws.rs.Produces; | ||
import javax.ws.rs.WebApplicationException; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.MultivaluedMap; | ||
import javax.ws.rs.ext.MessageBodyWriter; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import com.fasterxml.jackson.databind.ObjectWriter; | ||
|
||
@Produces("application/json") | ||
public class TestJacksonBasicMessageBodyWriter implements MessageBodyWriter<Object> { | ||
|
||
private final ObjectWriter wWriter; | ||
|
||
public TestJacksonBasicMessageBodyWriter() { | ||
this.wWriter = new ObjectMapper().writer(); | ||
} | ||
|
||
@Override | ||
public final boolean isWriteable(Class<?> type, Type genericType, | ||
Annotation[] annotations, MediaType mediaType) { | ||
return true; | ||
} | ||
|
||
@Override | ||
public void writeTo(Object o, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, | ||
MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, | ||
WebApplicationException { | ||
doLegacyWrite(o, annotations, httpHeaders, entityStream, wWriter); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.