8000 Providing MessageConverter for RestTemplate · Issue #206 · androidannotations/androidannotations · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Providing MessageConverter for RestTemplate #206

@pyricau

Description

@pyricau

@royclarkson just let me know that the RestTemplate default constructor now comes with no MessageConverters, for performance reasons.

It's quite obvious that no one needs all the default converters, we usually only need one converter.

This change also means that by default, a @Rest annotated interface will come with en empty RestTemplate that will have no MessageConverter. To add one, we must do: restClient.getRestTemplate().getMessageConverters().add(new MappingJacksonHttpMessageConverter());

We should provide a new annotation (or a new attribute) to let users specify the MessageConverters.

@Rest 
@Converters({MappingJacksonHttpMessageConverter.class, XmlAwareFormHttpMessageConverter.class})
public interface RestClient {
}

We should check that they have a default constructor. We could also allow classes annotated with @EBean, but I'm not sure this would provide much added value for now.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0