Configure security values¶
The generator uses validSecurityValues to build a baseline valid case (and to generate auth-related negative cases).
YAML config¶
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.
Related docs¶
- CLI reference - CLI settings syntax
- Gradle plugin reference - Gradle testGenerationSettings DSL
- Distribution settings - All settings reference