Skip to content

[2152] Do not inject Jackson dependencies - JAX-RS spec client #6296

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

keithchong
Copy link

PR checklist

  • Read the contribution guidelines.
  • Ran the shell script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in .\bin\windows\.
  • Filed the PR against the correct branch: master for non-breaking changes and 3.0.0 branch for breaking (non-backward compatible) changes.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

} else {
} else if ("jaxrs-spec".equals(getLibrary())) {
// Don't include Jackson and GSON
additionalProperties.remove("jackson");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need to remove them since they were not added ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Looks like they can be removed, so it will be an empty block.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, the last dependency on migbase64 is in Java/auth/HttpBasicAuth.mustache. It has the import on com.migcomponents.migbase64.Base64.

We could possibly use the built-in Java 8 (API since 1.8) java.util.Base64, that will force users to use Java 8.

So from:
Base64.encodeToString(str.getBytes("UTF-8"), false));
To:
Base64.getEncoder().encodeToString(str.getBytes("UTF-8"))

What are your thoughts on this? Then we could close off #2153 with 'zero' third party dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keithchong keithchong force-pushed the 2152-DoNotInjectJacksonDependencies-JaxRsSpecClient branch 2 times, most recently from 0df24df to e9a5e37 Compare August 14, 2017 15:54
@keithchong keithchong force-pushed the 2152-DoNotInjectJacksonDependencies-JaxRsSpecClient branch from e9a5e37 to cbd048d Compare August 14, 2017 16:01
@keithchong
Copy link
Author

Two additional notes about the file changes:

a) I did not intentional change these files, but there appears to be two files with conflicting names in samples/client/petstore/typescript-angular2/with-interfaces/model.

apiResponse.ts and ApiResponse.ts

I was not able to keep both when using eGit.

b) Although most of the mustache files are 'similiar' to other libraries, I'd like to more critique on: modules/swagger-codegen/src/main/resources/Java/libraries/jaxrs-spec/ApiClient.mustache.
eg. in the serialize method, I made a comment on multipart/form-data. In other libraries, it is supported.

@wing328
Copy link
Contributor

wing328 commented Aug 30, 2017

@keithchong thanks for the PR. I got errors when running mvn test with the Java (jaxrs-spec) petstore client: https://github.com/swagger-api/swagger-codegen/tree/keithchong-2152-DoNotInjectJacksonDependencies-JaxRsSpecClient/samples/client/petstore/java/jaxrs-spec

I wonder if you can take a look to see if you can reproduce the error.

@wing328
Copy link
Contributor

wing328 commented Oct 3, 2017

@keithchong do you need help reproducing the issue?

@keithchong
Copy link
Author

Hi @wing328, it appears that the sample tests for jaxrs-spec are not there, correct?

@wing328
Copy link
Contributor

wing328 commented Oct 16, 2017

@keithchong I manually created the jaxrs-spec petstore samples when testing it. I can recreate that branch tomorrow.

@wing328
Copy link
Contributor

wing328 commented Oct 17, 2017

@wing328
Copy link
Contributor

wing328 commented Nov 27, 2017

@keithchong do you need help reproducing the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants