Skip to content

v0.0.1-rc1: First release candidate

Pre-release
Pre-release

Choose a tag to compare

@lewishazell lewishazell released this 07 May 23:38

I'm pleased to announce the first release candidate of the OpenAPI Generator Cucumber Plugin - a tool that bridges OpenAPI code generation and Cucumber-style API testing!

This plugin brings language-agnostic testing to your API clients by generating the code needed to run existing Cucumber test specifications against OpenAPI Generator-produced client libraries. Write your Cucumber scenarios once, and validate the behavior of generated clients across multiple languages using a consistent testing approach.

Features

Language-agnostic Cucumber test execution

This plugin enables execution of hand-written Cucumber test specifications against OpenAPI Generator–generated client libraries. It:

  • Generates the step implementations required to run Cucumber scenarios against clients in:
    • C#
    • Java
    • Go
    • Python
    • TypeScript (Node.js)
  • Integrates into the OpenAPI Generator CLI via custom templates
  • Works with any OpenAPI schema - bring your own *.feature files and test logic

The included automation tests use petstore-extended.yaml and sample Cucumber scenarios for validation, but the plugin itself is schema-agnostic.

Works with standard tools:

Example test scenario

The following scenario tests the findPetById operation from the petstore-extended OpenAPI specification, asserting a 200 OK response and expected content:

Scenario: Successfully find a pet at the pet store
This scenario ensures that the user can successfully retrieve a pet from the store by its ID.

Given there is a "findPetById" request for the "DefaultApi"
And the "id" parameter has a value of "1"
When the request is sent
Then the response status should be 200
And the response content should be:
  """
  { "name": "Fluffy", "tag": "cat", "id": 1 }
  """

These human-readable scenarios make it easy to test real-world client behavior across multiple runtimes.

What's in this release?

This release candidate focuses on:

  • Establishing the core plugin structure and language templates
  • Testing full-stack codegen + test execution across 5 languages
  • Providing an extensible and maintainable testing framework

Limitations & notes

  • This is a pre-release (rc1): expect APIs and templates to evolve.
  • Language templates may differ slightly in output style or assumptions.
  • API authorization in tests is not currently supported - this is planned.
  • Some templates only support UTF-8 JSON responses - a fix is in progress.

Installation & usage

  1. Install prerequisites
    Ensureopenapi-generator-cli is installed and available in your PATH.
  2. Download the plugin JAR
    You can download the plugin directly from this release:
    wget https://github.com/lewishazell/openapi-generator-cucumber-plugin/releases/download/v0.0.1-rc1/openapi-generator-cucumber-plugin-0.0.1-rc1.jar -O path/to/openapi-generator-cucumber-plugin-0.0.1-rc1.jar
  3. Generate a client, copy in your Cucumber feature files, and run the tests
    # Generate your Python client and accompanying Cucumber step implementations
    openapi-generator-cli generate \
      --custom-generator path/to/openapi-generator-cucumber-plugin-0.0.1-rc1.jar \
      -g python-cucumber \
      -i path/to/your/openapi-spec.yaml \
      -p cucumberTargetHost=http://localhost:4010 \
      -o python-sdk/
    
    # Copy your Cucumber feature files into the output folder
    cp -r features python-sdk
    
    # Run the tests using Cucumber
    cd python-sdk
    pytest