Skip to content

TypeConstrainedMappingJackson2HttpMessageConverter overrides custom HttpMessageConverter #734

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

Closed
rsamant14 opened this issue Aug 20, 2018 · 1 comment

Comments

@rsamant14
Copy link

rsamant14 commented Aug 20, 2018

I have a custom message convertor that is supposed to convert the following class (EntityResponse ) to application/json

controller returns=> class EntityResponse extends ResourceSupport
@produces=>application/json

custom message converter=>

class EntityResponseJsonMessageConverter<T extends ResourceSupport>
                                 extends AbstractHttpMessageConverter<T>{
    @Override
    public boolean supports(Class<?> clazz) {
        return EntityResponse.class.equals(clazz);
    }
}

Unfortunately before my message converter can kick in TypeConstrainedMappingJackson2HttpMessageConverter kicks in

I need EntityResponseJsonMessageConverter to convert any EntityReponse to json, and all other resourcesupport classes to be handled by the default TypeConstrainedMappingJackson2HttpMessageConverter

Can i change the order of the message converters (have my custom message convertor execute before
TypeConstrainedMappingJackson2HttpMessageConverter). How do i set the priority on a message converter (TypeConstrainedMappingJackson2HttpMessageConverter). I am using spring boot.

Appreciate the help.

Thank you

@odrotbohm odrotbohm changed the title TypeConstrainedMappingJackson2HttpMessageConverter overrides custom json messageconvertor TypeConstrainedMappingJackson2HttpMessageConverter overrides custom HttpMessageConverter Aug 20, 2018
@gregturn
Copy link
Contributor

gregturn commented Mar 5, 2019

Superseded by #833

@gregturn gregturn closed this as completed Mar 5, 2019
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

2 participants