touchbit / retrofit-veslo

Extension of the 'Retrofit' library for developing automated tests for API testing.
Apache License 2.0
8 stars 0 forks source link

Registering a converter for annotated models #12

Closed shaburov closed 2 years ago

shaburov commented 2 years ago

Model

@JacksonModelAnnotation
public class UserDTO {

    private String firstName;
    private String lastName;

}

Registering a converter for annotated model

public class JacksonConverterFactory extends ExtensionConverterFactory {

    public JacksonConverterFactory(Logger logger, ExtensionConverter<Object> jacksonConverter) {
        super(logger);
        registerModelAnnotationConverter(jacksonConverter, JacksonModelAnnotation.class);
    }

}