OpenAPI to Karate Generator
Section titled “OpenAPI to Karate Generator”Generates test for KarateDSL based on OpenAPI and Arazzo specifications.
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=serviceOverlays
Section titled “Overlays”Use apiOverlayFiles to patch the OpenAPI source before dereferencing and allOf merge.
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=serviceOverlay files are applied in order. This is intended for local files and file-backed classpath: resources.
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,deleteCustomerOptions
Section titled “Options”| Option | Description | Type | Default | Values |
|---|---|---|---|---|
specFile | API Specification File | URI | ||
apiOverlayFiles | Ordered list of API overlay YAML files applied before dereferencing and allOf merge. | List | [] | |
targetFolder | Target folder to generate code to. If left empty, it will print to stdout. | File | ||
basePackage | Applications base package | String | ||
testsPackage | Package name for generated tests | String | {{basePackage}}.adapters.web.tests | |
groupBy | Generate test classes grouped by | GroupByType | service | service, operation, partial, businessFlow |
operationIds | OpenAPI operationIds to generate code for | List | [] | |
businessFlowTestName | Business Flow Test name | String |
Getting Help
Section titled “Getting Help”jbang zw -p io.zenwave360.sdk.plugins.OpenAPIKaratePlugin --help