Skip to content

Generates test for KarateDSL based on OpenAPI and Arazzo specifications.

Terminal window
jbang zw -p io.zenwave360.sdk.plugins.OpenAPIKaratePlugin \
specFile=src/main/resources/model/openapi.yml \
apiOverlayFiles=src/main/resources/model/openapi-overlay.yml \
targetFolder=src/test/resources \
testsPackage=io.zenwave360.example.adapters.web.tests \
groupBy=service

Use apiOverlayFiles to patch the OpenAPI source before dereferencing and allOf merge.

Terminal window
jbang zw -p io.zenwave360.sdk.plugins.OpenAPIKaratePlugin \
specFile=src/main/resources/model/openapi.yml \
apiOverlayFiles=src/main/resources/model/openapi-overlay.yml \
targetFolder=src/test/resources \
testsPackage=io.zenwave360.example.adapters.web.tests \
groupBy=service

Overlay files are applied in order. This is intended for local files and file-backed classpath: resources.

Terminal window
jbang zw -p io.zenwave360.sdk.plugins.OpenAPIKaratePlugin \
specFile=src/main/resources/model/openapi.yml \
targetFolder=src/test/resources \
testsPackage=io.zenwave360.example.adapters.web.tests \
groupBy=businessFlow \
businessFlowTestName=CustomerCRUDTest \
operationIds=createCustomer,getCustomer,updateCustomer,deleteCustomer
OptionDescriptionTypeDefaultValues
specFileAPI Specification FileURI
apiOverlayFilesOrdered list of API overlay YAML files applied before dereferencing and allOf merge.List[]
targetFolderTarget folder to generate code to. If left empty, it will print to stdout.File
basePackageApplications base packageString
testsPackagePackage name for generated testsString{{basePackage}}.adapters.web.tests
groupByGenerate test classes grouped byGroupByTypeserviceservice, operation, partial, businessFlow
operationIdsOpenAPI operationIds to generate code forList[]
businessFlowTestNameBusiness Flow Test nameString
Terminal window
jbang zw -p io.zenwave360.sdk.plugins.OpenAPIKaratePlugin --help