Skip to content
This repository has been archived by the owner on Dec 31, 2024. It is now read-only.

decorating JacksonEncoder ignores #94

Open
GoodBoy962 opened this issue Aug 20, 2020 · 2 comments
Open

decorating JacksonEncoder ignores #94

GoodBoy962 opened this issue Aug 20, 2020 · 2 comments

Comments

@GoodBoy962
Copy link

GoodBoy962 commented Aug 20, 2020

While trying to use FormEncoder with JacksonEncoder encoder faced with ignoring 2nd one.

Wrapping JAX-RS with Feign

Feign.builder()
                .encoder(new FormEncoder(new JacksonEncoder()))
                .decoder(new JacksonDecoder())
                .contract(new JAXRSContract())
                .logger(new FeignSlf4jMultilineLogger(ApiClient.class))
                .logLevel(Logger.Level.FULL)
                .target(ApiClient.class, address);

JAX-RS service

public interface ApiClient {

    @POST
    @Path("/token/")
    @Consumes(MediaType.APPLICATION_FORM_URLENCODED)
    Response getAccessToken(@HeaderParam("Authorization") String authSecret, Request request);
}

Request

@Getter
@Setter
public class Request {
    @JsonProperty("client_id")
    private String clientId;
    @JsonProperty("scope")
    private String scope;
    @JsonProperty("grant_type")
    private String grantType;

Request sends with grantType=something&scope=something&clientId=11111

What should we add not to ignore JsonProperty annotations?

@alexyakovlev90
Copy link

Have you tried @FormProperty("client_id")?

@slawekjaranowski
Copy link

can be connected with:: #95

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

No branches or pull requests

3 participants