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