conjure-java-runtime icon indicating copy to clipboard operation
conjure-java-runtime copied to clipboard

Retrofit clients should treat HTTP 204 as empty

Open iamdanfox opened this issue 7 years ago • 6 comments

Our jax-rs clients already interpret a http 204 as Optional.empty, but the retrofit clients return it as null!

    @Test
    public void retrofit2_client_can_retrieve_an_optional_empty() throws Exception {
        assertThat(client.optionalEmpty(AuthHeader.valueOf("authHeader")).execute().body())
                .isEqualTo(Optional.empty());
    }
org.junit.ComparisonFailure: 
Expected :Optional.empty
Actual   :null
 <Click to see difference>

iamdanfox avatar Feb 13 '18 14:02 iamdanfox

This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.

stale[bot] avatar Oct 19 '18 23:10 stale[bot]

Would like to keep this open until this runs the standardized test-cases.yml from conjure-verification

iamdanfox avatar Oct 22 '18 19:10 iamdanfox

This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.

stale[bot] avatar Dec 21 '18 21:12 stale[bot]

Looking into solving this once and for all... we are already running the conjure-verification test harness (added in https://github.com/palantir/conjure-java-runtime/pull/853), but only for JaxRsClients.

Next steps are:

  • rework VerificationClients so that it can create retrofit2 clients
  • modify AutoDeserializeTest and SingleParamServicesTest somehow so that they can use both jaxrs and retrofit clients
  • ensure there can be a separate ignored-test-cases.yml for retrofit and jaxrs clients

iamdanfox avatar Jan 02 '19 12:01 iamdanfox

Seen in <redacted internal jira>/PDS-88221.

hsaraogi avatar Apr 16 '19 16:04 hsaraogi

This issue has been automatically marked as stale because it has not been touched in the last 60 days. Please comment if you'd like to keep it open, otherwise it'll be closed in 7 days time.

stale[bot] avatar Sep 23 '19 14:09 stale[bot]