Open ctoestreich opened 9 years ago
The json response is coming from a controller with the following code
def handleUserNotAuthenticated() {
response.status = HttpStatus.SC_UNAUTHORIZED
render createErrorViewModelFromException('User must be logged in.') as JSON
}
The object generated ultimately has an enum like this
enum MessageType {
CONFIRMATION,
ERROR,
INFORMATIONAL
}
@graemerocher I added a test to the spec that illustrates this behavior and fails
https://github.com/Grails-Plugin-Consortium/grails-rest-client-builder
I think this is the same as https://jira.grails.org/browse/GRAILS-11801, which doesn't seem to have been migrated to a Github issue for some reason.
When calling new RestBuilder from a controller, the custom json marshaling registered in the bootstrap are thrown disposed of and json marshalling returns to default state.
Bootstrap
Custom JSON Marshaler Registration
Controller Method
Json before calling controller method
Json after calling controller method
JVM: 1.7 Grails: 2.3.8 Plugin: 2.0.3