Skip to content
GitLab
    • Explore Projects Groups Snippets
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Merge requests
  • !3481

[Java][RestTemplate] remove wrong Null Check

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/tjnet/fix_issue_3480 into master 6 years ago
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 3

Created by: tjnet

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, ./bin/openapi3/{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\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.
  • Filed the PR against the correct branch: master, 4.1.x, 5.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

Description of the PR

I just wanted to fix #3480 (closed) .

But I'm a newbie. I'm new to this. Is this correct? Please review in your free time.

How to test

I ran following command and commit changed files.

  • mvn verify
  • bin/java-petstore-resttemplate.sh
  • bin/java-petstore-resttemplate-withxml.sh
Compare
  • master (base)

and
  • latest version
    af153841
    1 commit, 2 years ago

3 files
+ 0
- 9

    Preferences

    File browser
    Compare changes
modules/…/…/…/…/‎…/…/resttemplate‎
ApiClient‎.mustache‎ +0 -3
samples/client‎/petstore/java‎
resttemplate-withXm‎l/src/…/…/…/…/client‎
ApiClie‎nt.java‎ +0 -3
resttemplate/sr‎c/…/…/…/…/client‎
ApiClie‎nt.java‎ +0 -3
modules/openapi-generator/src/main/resources/Java/libraries/resttemplate/ApiClient.mustache
+ 0
- 3
  • View file @ af153841

  • Edit in single-file editor

  • Open in Web IDE


@@ -619,9 +619,6 @@ public class ApiClient {
if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) {
return null;
} else if (responseEntity.getStatusCode().is2xxSuccessful()) {
if (returnType == null) {
return null;
}
return responseEntity.getBody();
} else {
// The error handler built into the RestTemplate should handle 400 and 500 series errors.
samples/client/petstore/java/resttemplate/src/main/java/org/openapitools/client/ApiClient.java
+ 0
- 3
  • View file @ af153841

  • Edit in single-file editor

  • Open in Web IDE


@@ -602,9 +602,6 @@ public class ApiClient {
if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) {
return null;
} else if (responseEntity.getStatusCode().is2xxSuccessful()) {
if (returnType == null) {
return null;
}
return responseEntity.getBody();
} else {
// The error handler built into the RestTemplate should handle 400 and 500 series errors.
samples/client/petstore/java/resttemplate-withXml/src/main/java/org/openapitools/client/ApiClient.java
+ 0
- 3
  • View file @ af153841

  • Edit in single-file editor

  • Open in Web IDE


@@ -607,9 +607,6 @@ public class ApiClient {
if (responseEntity.getStatusCode() == HttpStatus.NO_CONTENT) {
return null;
} else if (responseEntity.getStatusCode().is2xxSuccessful()) {
if (returnType == null) {
return null;
}
return responseEntity.getBody();
} else {
// The error handler built into the RestTemplate should handle 400 and 500 series errors.
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
2
Client: Java Issue: Bug
2
Client: Java Issue: Bug
    Assign labels
  • Manage project labels

Milestone
4.1.0
4.1.0 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: OpenAPITools/openapi-generator!3481
Source branch: github/fork/tjnet/fix_issue_3480

Menu

Explore Projects Groups Snippets