Skip to content

Configure security values

The generator uses validSecurityValues to build a baseline valid case (and to generate auth-related negative cases).

YAML config

testGenerationSettings:
  validSecurityValues:
    ApiKeyAuth: "test-api-key-123"

CLI override

--setting keys map directly to TestGenerationSettings fields:

openapi-testgen \
  --spec-file ./openapi.yaml \
  --output-dir ./build/generated \
  --generator template \
  --setting validSecurityValues.ApiKeyAuth=test-api-key-123

Gradle DSL

openApiTestGenerator {
    testGenerationSettings {
        validSecurityValues.put("ApiKeyAuth", "test-api-key-123")
    }
}

OAuth2/OpenID Connect scope metadata

For OAuth2 and OpenID Connect schemes, generated test cases can include structured scope metadata in securityValues.other.authorizationScopes.

See TestCase for the canonical schema, examples, and presence rules.