Skip to content

Support library template (sub-template); add jersey2 template for Java client #1046

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

Merged
merged 15 commits into from
Aug 23, 2015
Merged

Support library template (sub-template); add jersey2 template for Java client #1046

merged 15 commits into from
Aug 23, 2015

Conversation

xhh
Copy link
Contributor

@xhh xhh commented Aug 5, 2015

See #950 for background and context of this PR.

  • Added a library config option to specify the library template (sub-template) to be used

    $  java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l java
    CONFIG OPTIONS
    ...
        library
            library template (sub-template) to use:
            <default> - HTTP client: Jersey client 1.18. JSON processing: Jackson 2.4.2
            jersey2 - HTTP client: Jersey client 2.6
  • Refactored ApiClient#invokeAPI and JSON handling to make it easier to override underlying HTTP client and JSON processing

  • Added a jersey2 library template to generate Java client with jersey-client 2.6 instead of the default 1.18

    $ ./bin/java-petstore-jersey2.sh
    ...
    
    cat samples/client/petstore/java/jersey2/pom.xml
    ...
    <jersey-version>2.6</jersey-version>
    ...

    The jersey2 template is mainly from PR updated client to use jersey2, rebuilt samples #950 by @fehguy

@fehguy please have a look at this, and if you have any concerns (e.g. the naming of the library option), please comment and I'll revise accordingly

@xhh xhh changed the title Support library template (sub-template); add jersey2 library template for Java client Support library template (sub-template); add jersey2 template for Java client Aug 5, 2015
xhh added 5 commits August 7, 2015 21:18
Conflicts:
	modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache
Conflicts:
	modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java
	modules/swagger-codegen/src/main/resources/Java/api.mustache
@fehguy
Copy link
Contributor

fehguy commented Aug 21, 2015

ok wow. This does look good to me. I'll see about the conflicts and report back if i can't merge it

Conflicts:
	modules/swagger-codegen/src/main/resources/Java/JsonUtil.mustache
@xhh
Copy link
Contributor Author

xhh commented Aug 22, 2015

@fehguy I've just fixed the conflicts.

@fehguy fehguy merged commit 5690827 into swagger-api:develop_2.0 Aug 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants