OpenFeign / feign

Feign makes writing java http clients easier
Apache License 2.0
9.5k stars 1.93k forks source link

How use jax-rs @DefaultValue annotation in feign? #1931

Closed RussiaVk closed 1 year ago

RussiaVk commented 1 year ago

I want some parameter keep it default value but specific. So I tryed set it as null. but It be ignored in request(I debug in log file). So how use jax-rs @DefaultValue annotation in feign correctly ?

    interface _interface {
        String req(
        @QueryParam("lang") String  requiredParameter,
        @QueryParam("lang") @DefaultValue("zh_CN") String requiredParameterAndIWantItDefault);
    }
    _interface i = Feign.builder().contract(new JAXRSContract())
                 .target(_interface.class, HOST);
        String resp = i.req("value",null);
JKomoroski commented 1 year ago

Feign does not support the entire Jax-RS spec. Supported annotations are documented in the readmes for those contracts ie:

https://github.com/OpenFeign/feign/tree/master/jaxrs2#readme

It probably wouldn't be too difficult to add support.

RussiaVk commented 1 year ago

Feign does not support the entire Jax-RS spec. Supported annotations are documented in the readmes for those contracts ie:

https://github.com/OpenFeign/feign/tree/master/jaxrs2#readme

It probably wouldn't be too difficult to add support.

ohh,It's a bad news