amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
547 stars 722 forks source link

clients/sellingpartner-api-aa-java/pom.xml using very old okhttp dependency that conflicts with Amazon Ads API dependencies #645

Open csimoes1 opened 2 months ago

csimoes1 commented 2 months ago

clients/sellingpartner-api-aa-java/pom.xml has:

       <dependency>
            <groupId>com.squareup.okhttp</groupId>
            <artifactId>okhttp</artifactId>
            <version>2.7.5</version>
        </dependency>

Many other parts of my project are using okhttp3, something like:

      <dependency>
            <groupId>com.squareup.okhttp3</groupId>
            <artifactId>okhttp</artifactId>
            <version>4.12.0</version>
        </dependency>

Converting this is relatively straightforward. It seems you just need to update the "LWAAuthorizationSigner" and "LWAClient" classes to use okhttp3 instead of okhttp, particularly for the Request object. Reporting this just to bring it to your attention. I was running my project in a servlet container, and the class path loading was causing a runtime crash due to okhttp having a class called ByteStream that was not resolving properly.

harguph commented 2 months ago

Thank you for bringing this up.

We are currently working on this.

wienczny commented 1 month ago

For the Java client please consider the following:

This way an APIClient without custom templates would be possible. Easier to build with default configuration and less problems during updates. Alternative HTTP client libraries can be implemented.

harguph commented 1 month ago

Thank you for sharing the details.