ory / sdk

The place where ORY's SDKs are being auto-generated
Apache License 2.0
141 stars 85 forks source link

Hydra spec misses schema for logout/accept (and reject) body, making the java client throw an NPE #199

Closed MiniDigger closed 2 years ago

MiniDigger commented 2 years ago

Preflight checklist

Describe the bug

when calling hydraClient.acceptLogoutRequest(challenge), okhttp throws an NPE (see below) Generated code misses the content type: https://i.imgur.com/yllPIbC.png Schema has no body for logout/accept (login has them): https://i.imgur.com/ZpuH2xA.png

Reproducing the bug

run hydraClient.acceptLogoutRequest(challenge)

Relevant log output

java.lang.NullPointerException: Parameter specified as non-null is null: method okhttp3.MediaType$Companion.parse, parameter $this$toMediaTypeOrNull
    at okhttp3.MediaType$Companion.parse(MediaType.kt)
    at okhttp3.MediaType.parse(MediaType.kt)
    at sh.ory.hydra.ApiClient.buildRequest(ApiClient.java:1225)
    at sh.ory.hydra.ApiClient.buildCall(ApiClient.java:1181)
    at sh.ory.hydra.api.AdminApi.acceptLogoutRequestCall(AdminApi.java:449)
    at sh.ory.hydra.api.AdminApi.acceptLogoutRequestValidateBeforeCall(AdminApi.java:461)
    at sh.ory.hydra.api.AdminApi.acceptLogoutRequestWithHttpInfo(AdminApi.java:500)
    at sh.ory.hydra.api.AdminApi.acceptLogoutRequest(AdminApi.java:481)
    at io.papermc.hangarauth.controller.OAuthController.logout(OAuthController.java:229)

Relevant configuration

No response

Version

hydra java client 1.11.8

On which operating system are you observing this issue?

Windows

In which environment are you deploying?

Docker

Additional Context

No response

MiniDigger commented 2 years ago

am an idiot, this is a duplicate of https://github.com/ory/hydra-client-java/issues/14 and will hopefully be fixed by https://github.com/ory/sdk/pull/192