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
  • !1165

Don't generate unused ApiException class for java/webclient.

  • Review changes

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

Created by: moreginger

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, 3.4.x, 4.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

Cleanup of java/webclient templates and supporting files, in particular removing unused ApiException class.

cc @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01)

Compare
  • master (base)

and
  • latest version
    13aa42df
    1 commit, 2 years ago

18 files
+ 54
- 344

    Preferences

    File browser
    Compare changes
modules/openapi-g‎enerator/src/main‎
java/org/openapitoo‎ls/codegen/languages‎
JavaClientC‎odegen.java‎ +4 -1
resources/Java/li‎braries/webclient‎
api.mu‎stache‎ +1 -2
api_test‎.mustache‎ +1 -5
samples/client/pets‎tore/…/webclient/src‎
main/java/org/op‎enapitools/client‎
a‎pi‎
AnotherFa‎keApi.java‎ +0 -1
FakeAp‎i.java‎ +0 -1
FakeClassnameT‎ags123Api.java‎ +0 -1
PetAp‎i.java‎ +0 -1
StoreA‎pi.java‎ +0 -1
UserAp‎i.java‎ +0 -1
ApiExcep‎tion.java‎ +0 -91
Configura‎tion.java‎ +0 -39
Pair‎.java‎ +0 -61
test/java/org/open‎apitools/client/api‎
AnotherFake‎ApiTest.java‎ +1 -5
FakeApiT‎est.java‎ +23 -40
FakeClassnameTag‎s123ApiTest.java‎ +1 -5
PetApiT‎est.java‎ +11 -39
StoreApi‎Test.java‎ +4 -17
UserApiT‎est.java‎ +8 -33
modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/JavaClientCodegen.java
+ 4
- 1
  • View file @ 13aa42df

  • Edit in single-file editor

  • Open in Web IDE


@@ -269,10 +269,13 @@ public class JavaClientCodegen extends AbstractJavaCodegen
apiDocTemplateFiles.remove("api_doc.mustache");
}
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()))) {
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()) || WEBCLIENT.equals(getLibrary()))) {
supportingFiles.add(new SupportingFile("apiException.mustache", invokerFolder, "ApiException.java"));
supportingFiles.add(new SupportingFile("Configuration.mustache", invokerFolder, "Configuration.java"));
supportingFiles.add(new SupportingFile("Pair.mustache", invokerFolder, "Pair.java"));
}
if (!(FEIGN.equals(getLibrary()) || RESTTEMPLATE.equals(getLibrary()) || usesAnyRetrofitLibrary() || GOOGLE_API_CLIENT.equals(getLibrary()) || REST_ASSURED.equals(getLibrary()))) {
supportingFiles.add(new SupportingFile("auth/Authentication.mustache", authFolder, "Authentication.java"));
}
modules/openapi-generator/src/main/resources/Java/libraries/webclient/api.mustache
+ 1
- 2
  • View file @ 13aa42df

  • Edit in single-file editor

  • Open in Web IDE


@@ -5,8 +5,7 @@ import {{invokerPackage}}.ApiClient;
{{#imports}}import {{import}};
{{/imports}}
{{^fullJavaUtil}}import java.util.ArrayList;
import java.util.HashMap;
{{^fullJavaUtil}}import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;{{/fullJavaUtil}}
modules/openapi-generator/src/main/resources/Java/libraries/webclient/api_test.mustache
+ 1
- 5
  • View file @ 13aa42df

  • Edit in single-file editor

  • Open in Web IDE


@@ -2,7 +2,6 @@
package {{package}};
import {{invokerPackage}}.ApiException;
{{#imports}}import {{import}};
{{/imports}}
import org.junit.Test;
@@ -28,12 +27,9 @@ public class {{classname}}Test {
* {{summary}}
*
* {{notes}}
*
* @throws ApiException
* if the Api call fails
*/
@Test
public void {{operationId}}Test() throws ApiException {
public void {{operationId}}Test() {
{{#allParams}}
{{{dataType}}} {{paramName}} = null;
{{/allParams}}
samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/AnotherFakeApi.java
+ 0
- 1
  • View file @ 13aa42df

  • Edit in single-file editor

  • Open in Web IDE


@@ -4,7 +4,6 @@ import org.openapitools.client.ApiClient;
import org.openapitools.client.model.Client;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
samples/client/petstore/java/webclient/src/main/java/org/openapitools/client/api/FakeApi.java
+ 0
- 1
  • View file @ 13aa42df

  • Edit in single-file editor

  • Open in Web IDE


@@ -11,7 +11,6 @@ import java.time.OffsetDateTime;
import org.openapitools.client.model.OuterComposite;
import org.openapitools.client.model.User;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
2
Client: Java Enhancement: General
2
Client: Java Enhancement: General
    Assign labels
  • Manage project labels

Milestone
3.3.2
3.3.2 (expired)
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
1
1 participant
Administrator
Reference: OpenAPITools/openapi-generator!1165
Source branch: github/fork/moreginger/master

Menu

Explore Projects Groups Snippets