ory / sdk

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

feat: bump java clients openapi-generator to 6.0.0 #192

Closed lrenard-qima closed 1 year ago

lrenard-qima commented 2 years ago

Context : A bug has been fixed in the release 6.0.0 of openapi-generator. It fixes a NPE when trying to perform a PUT with an empty body while using the ApiClient generated with openapi-generator. Link to the fix on openapi-generator : https://github.com/OpenAPITools/openapi-generator/pull/12172

In my case I am having this error when calling Hydra Admin API to accept logout request. It is building a PUT request with an empty body and it ends up with a NPE.

Idea is to upgrade openapi-generator version to include the fix in generated ory/hydra-client-java.

For a more detailed overview of the bug I have created a ticket on ory/sdk repository that is mentionent below (in Related Issue or Design Document part)

BREAKING CHANGES: 

This patch bumps the version of openapi-generator used to generate Java clients from 5.4.0 to 6.0.0.

Related Issue or Design Document

Linked to bug ticket on ory/sdk : https://github.com/ory/sdk/issues/191

Checklist

Further comments

aeneasr commented 2 years ago

Thank you! :) Are there breaking changes in the 6.0 generate that we need to be aware of?

lrenard-qima commented 2 years ago

Thank you! :) Are there breaking changes in the 6.0 generate that we need to be aware of?

You are welcome =) I have not investigated it enough. I leave the PR as a draft while I check that :)

aeneasr commented 2 years ago

Great, thanks!

aeneasr commented 2 years ago

Hi, I'm just echoing my message from slack:

Hi Lucas, thank you! I think the info that they fixed an important bug is enough for me to get it merged :slightly_smiling_face: For breaking changes, you can also always look at the release change log from open api generator itself: https://github.com/OpenAPITools/openapi-generator/releases/tag/v6.0.0#java

Screenshot 2022-06-22 at 10 22 34

One last thing we need to do though is that we probably need to update the dependencies to match the 6.0 generator here: https://github.com/ory/sdk/tree/master/contrib/poms

When I upgraded to 5.4.0 these were the changes I had to make (please only look at the POM changes):

https://github.com/ory/sdk/commit/303c725db6c25bd41169387e0db90f69ab70963a

Regarding the question you had on slack, mix is from elixir so if you don't have it installed that will fail. A better option is to use what is written in the README:

https://github.com/ory/sdk#debugging-failing-circleci-tests

This will generate the code in your local file system!

geetparekh commented 2 years ago

Hello,

Curious as to in which version will the fix be available. We are also facing the same issue when calling Hydra Admin API to accept logout request. Thank you!

aeneasr commented 1 year ago

We updated the java generator