Skip to content
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

[Java][REQ#8015] [Client] Microprofile Jackson serialization support #15940

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

hightea
Copy link
Contributor

@hightea hightea commented Jun 27, 2023

This PR adds support for Jackson serialization in the Microprofile library for the Java client.
Two samples have been added, one with jackson serialization, the other with jackson AND xml.

Summary of changes:

PR checklist

  • Read the contribution guidelines.
  • Pull Request title clearly describes the work in the pull request and Pull Request description provides details about how to validate the work. Missing information here may result in delayed response from the community.
  • Run the following to build the project and update samples:
    ./mvnw clean package 
    ./bin/generate-samples.sh
    ./bin/utils/export_docs_generators.sh
    
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    For Windows users, please run the script in Git BASH.
  • In case you are adding a new generator, run the following additional script :
    ./bin/utils/ensure-up-to-date
    
    Commit all changed files.
  • File the PR against the correct branch: master (6.3.0) (minor release - breaking changes with fallbacks), 7.0.x (breaking changes without fallbacks)
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

@bbdouglas (2017/07) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) @karismann (2019/03) @Zomzog (2019/04) @lwlee2608 (2019/10)

@wing328
Copy link
Member

wing328 commented Jul 3, 2023

Thanks for the PR but your commit (as shown in the Commits tab) is not linked to your Github account, which means this PR won't count as your contribution in https://github.com/OpenAPITools/openapi-generator/graphs/contributors.

Let me know if you need help fixing it.

Ref: https://github.com/OpenAPITools/openapi-generator/wiki/FAQ#how-can-i-update-commits-that-are-not-linked-to-my-github-account

@hightea hightea force-pushed the feat/microprofile-jackson branch from c070039 to 38549cc Compare July 4, 2023 07:25
@hightea
Copy link
Contributor Author

hightea commented Jul 4, 2023

Thank you for the alert @wing328 !
I've modified my commit email, and fixed the failed check (the samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/.openapi-generator/FILES was not up-to-date).

@lostiniceland
Copy link
Contributor

This PR is highly anticipated. Thanks @hightea

@@ -0,0 +1,11 @@
generatorName: java
outputDir: samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add the new folders to .github/workflows/samples-java-client-jdk11.yaml so that the CI will test the changes moving forward?

Copy link
Member

Choose a reason for hiding this comment

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

I tested the output locally with mvn clean package but got the following errors (partial output):

[ERROR] /Users/williamcheng/Code/openapi-generator7/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java:[74,6] cannot find symbol
[ERROR]   symbol:   class XmlEnumValue
[ERROR]   location: class org.openapitools.client.model.Pet.StatusEnum
[ERROR] /Users/williamcheng/Code/openapi-generator7/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java:[74,73] cannot find symbol
[ERROR]   symbol:   class XmlEnumValue
[ERROR]   location: class org.openapitools.client.model.Pet.StatusEnum
[ERROR] /Users/williamcheng/Code/openapi-generator7/samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml/src/main/java/org/openapitools/client/model/Pet.java:[74,134] cannot find symbol
[ERROR]   symbol:   class XmlEnumValue
[ERROR]   location: class org.openapitools.client.model.Pet.StatusEnum
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for your tests. I'm currently in vacation, but I'll look into it as soon as possible.

Copy link
Member

Choose a reason for hiding this comment

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

Take your time. Enjoy your vacation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@wing328
Copy link
Member

wing328 commented Aug 12, 2023

circleci node 4 failure already fixed in the master.

@wing328
Copy link
Member

wing328 commented Aug 12, 2023

Tested locally again and the result is good. Thanks for the PR.

@wing328 wing328 merged commit 057bc8e into OpenAPITools:master Aug 12, 2023
@wing328
Copy link
Member

wing328 commented Aug 12, 2023

@lostiniceland the PR has been merged. Please feel free to sponsor @hightea work directly or indirectly via https://opencollective.com/openapi_generator

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.

[REQ] Java MicroPofile Rest client with Jackson serialization?
3 participants