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

Custom Marshallers Disposed When Calling new RestBuilder() #34

Open
ctoestreich opened this issue Feb 24, 2015 · 4 comments
Open

Custom Marshallers Disposed When Calling new RestBuilder() #34

ctoestreich opened this issue Feb 24, 2015 · 4 comments

Comments

@ctoestreich
Copy link

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
screen shot 2015-02-24 at 2 09 48 pm

Custom JSON Marshaler Registration
screen shot 2015-02-24 at 2 10 04 pm

Controller Method
screen shot 2015-02-24 at 2 07 59 pm

Json before calling controller method
screen shot 2015-02-24 at 2 08 41 pm

Json after calling controller method
screen shot 2015-02-24 at 2 08 58 pm

JVM: 1.7
Grails: 2.3.8
Plugin: 2.0.3

@ctoestreich
Copy link
Author

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
}

ctoestreich pushed a commit to Grails-Plugin-Consortium/grails-rest-client-builder that referenced this issue Feb 24, 2015
@ctoestreich
Copy link
Author

@graemerocher I added a test to the spec that illustrates this behavior and fails

https://github.com/Grails-Plugin-Consortium/grails-rest-client-builder

@tcrossland
Copy link

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.

@anielsen3
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants