Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RESTEASY-1532] Disable JsonGenerator.Feature.AUTO_CLOSE_TARGET
- Loading branch information
Showing
5 changed files
with
61 additions
and
1 deletion.
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
25 changes: 25 additions & 0 deletions
25
...org/jboss/resteasy/test/providers/jackson2/resource/ExceptionMapperIOExceptionMapper.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,25 @@ | ||
package org.jboss.resteasy.test.providers.jackson2.resource; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import javax.ws.rs.core.MediaType; | ||
import javax.ws.rs.core.Response; | ||
import javax.ws.rs.ext.ExceptionMapper; | ||
import javax.ws.rs.ext.Provider; | ||
|
||
/** | ||
* User: rsearls | ||
* Date: 10/26/16 | ||
*/ | ||
@Provider | ||
public class ExceptionMapperIOExceptionMapper implements ExceptionMapper<Throwable> { | ||
@Override | ||
public Response toResponse(Throwable e) { | ||
Map<String, Object> result = new HashMap<>(); | ||
result.put("err_msg", "UN_KNOWN_ERR"); | ||
result.put("err_detail", "please contact admin for help"); | ||
return Response.status(Response.Status.OK).entity(result) | ||
.type(MediaType.APPLICATION_JSON_TYPE).build(); | ||
|
||
} | ||
} |
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
10 changes: 10 additions & 0 deletions
10
...ion-tests/src/test/java/org/jboss/resteasy/test/providers/jackson2/resource/MyEntity.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,10 @@ | ||
package org.jboss.resteasy.test.providers.jackson2.resource; | ||
|
||
/** | ||
* A missing JSON annotation is intended. This causes the needed exception | ||
* for testing. | ||
* User: rsearls | ||
* Date: 10/13/16 | ||
*/ | ||
public class MyEntity { | ||
} |