Skip to content
GitLab
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
  • !452

[jaxrs-cfx][server] delete output dir before building sample files

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge github/fork/grokify/jaxrs-cfx/server/fix/build-new-sample-files into master Jul 04, 2018
  • Overview 0
  • Commits 4
  • Pipelines 0
  • Changes 3

Created by: grokify

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.1.x, 4.0.x. Default: master.
  • Copied the technical committee to review the pull request if your PR is targeting a particular programming language.

@bbdouglas @JFCote @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger

Description of the PR

Fixes https://github.com/OpenAPITools/openapi-generator/issues/451

bin/jaxrs-cxf-petstore-server.sh does not overwrite existing sample server files so bin/utils/ensure-up-to-date will not generate new files for jaxrs-cxf. This leads to build errors when new Petstore test endpoints are added because they are not present in the Impl implementation classes.

An example error is shown below:

https://circleci.com/gh/grokify/openapi-generator/38

[ERROR] COMPILATION ERROR : [ERROR] /home/circleci/OpenAPITools/openapi-generator/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java:[32,8] org.openapitools.api.impl.FakeApiServiceImpl is not abstract and does not override abstract method testBodyWithFileSchema(org.openapitools.model.FileSchemaTestClass) in org.openapitools.api.FakeApi [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project openapi-cxf-server: Compilation failure [ERROR] /home/circleci/OpenAPITools/openapi-generator/samples/server/petstore/jaxrs-cxf/src/main/java/org/openapitools/api/impl/FakeApiServiceImpl.java:[32,8] org.openapitools.api.impl.FakeApiServiceImpl is not abstract and does not override abstract method testBodyWithFileSchema(org.openapitools.model.FileSchemaTestClass) in org.openapitools.api.FakeApi [ERROR] -> [Help 1]

This change adds a line to bin/jaxrs-cxf-petstore-server.sh to remove the output directory before building the samples:

echo "Removing files and folders under samples/server/petstore/jaxrs-cxf"
rm -rf samples/server/petstore/jaxrs-cxf

This approach is used in other *.sh scripts as shown here in discussion with @jmini in https://github.com/OpenAPITools/openapi-generator/issues/451

https://github.com/OpenAPITools/openapi-generator/blob/d6e950f6818bb68efaed2b2bb9f82767a948f80b/bin/java-petstore-feign.sh#L32-L34

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/grokify/jaxrs-cfx/server/fix/build-new-sample-files