-
Notifications
You must be signed in to change notification settings - Fork 6k
[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
base: master
Are you sure you want to change the base?
[2152] Do not inject Jackson dependencies - JAX-RS spec client #6296
Conversation
} else { | ||
} else if ("jaxrs-spec".equals(getLibrary())) { | ||
// Don't include Jackson and GSON | ||
additionalProperties.remove("jackson"); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@keithchong that should be already done in the latest master: https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/Java/auth/HttpBasicAuth.mustache#L7-L13
0df24df
to
e9a5e37
Compare
e9a5e37
to
cbd048d
Compare
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. |
@keithchong thanks for the PR. I got errors when running I wonder if you can take a look to see if you can reproduce the error. |
@keithchong do you need help reproducing the issue? |
Hi @wing328, it appears that the sample tests for jaxrs-spec are not there, correct? |
@keithchong I manually created the jaxrs-spec petstore samples when testing it. I can recreate that branch tomorrow. |
UPDATE: added back the samples in that branch, https://github.com/swagger-api/swagger-codegen/tree/keithchong-2152-DoNotInjectJacksonDependencies-JaxRsSpecClient/samples/client/petstore/java/jaxrs-spec |
@keithchong do you need help reproducing the issue? |
PR checklist
./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\
.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)