openapi-generator/bin/windows/jaxrs-cxf-petstore-server-test-data.bat

11 lines
776 B
Batchfile
Raw Normal View History

JAX-RS/CXF 1158 Options to generate fully functional method bodies passing fully populated test data (#1879) * add option to generate alias as model * [JAXRS/CXF] Emit method bodies, test data (#1158) New jaxrs-cxf-extended generator with options: - supportMultipleSpringServices Support generation of Spring services from multiple specifications - generateOperationBody (boolean) Enables generation of fully functional test/service method bodies that pass/return random but valid values & models. - loadTestDataFromFile (boolean) When true, generated method bodies load test data from a generated JSON file. When false, generated method bodies contain inline code to construct the test data. - testDataFile (string) The path of a JSON file to contain generated test data. The file is initially generated but editable; edits are preserved by subsequent generations. - testDataControlFile (string) The path of a JSON file to control test data generation - specifically, to control the number of items required in array properties, structured by API class / operation name / parameter name. The file is initially generated but editable; edits are preserved by subsequent generations. - tests for the jaxrs-cxf-extended generator, including the new options Bug fixes: - fix bug (DefaultGenerator): handle absolute paths in supporting file spec - fix bug (DefaultCodegen): process enums in allVars - fix bug (AbstractJavaCodegen): support multiple inheritance via allOf (inheritance code deleted, as a subsequent pull broke it) - fix bug (JavaCXFServerCodegen): use operationId instead of nickname (gets out of step with duplicate operationIds) - fix bug (JavaCXFServerCodegen): set appropriate default consumes/produces for operations with body parameters or non-void returns (CXF providers don't handle */*) - fix indentation (DefaultCodegen) - add support for a system property openapitools.implementation.version to specify the package implementation version when running non-JAR'd classes in an IDE (otherwise {{{generatorVersion}}} evaluates to 'unset'. * reformat code * make sh executable * fix template folder * fix template folder, update samples * run test data manually to avoid ci failure
2019-03-06 00:58:11 +00:00
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
If Not Exist %executable% (
mvn clean package
)
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
set ags=generate --artifact-id cxf-test-data -t modules\openapi-generator\src\main\resources\JavaJaxRS\cxf-ext -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g jaxrs-cxf-extended -o samples\server\petstore\jaxrs-cxf-test-data -DhideGenerationTimestamp=true -DuseAnnotatedBasePath=true --generate-alias-as-model --additional-properties java8=true,generateSpringApplication=true,generateSpringBootApplication=true,generateOperationBody=true,loadTestDataFromFile=true %*
java %JAVA_OPTS% -jar %executable% %ags%