Core SPI (Extension Interfaces)¶
This document is non-normative and targets contributors building custom rules, providers, or generators. For core entry points, see the core module. For built-in catalogs, see rules and providers. For distribution defaults, see distribution settings. For contributor workflow, see development setup.
Overview¶
The SPI lives in core/src/main/kotlin/.../spi and defines the stable extension surface for the core module. Implementations should be deterministic, side-effect free, and compatible with the generation pipeline.
Pages¶
Rules¶
Rule interfaces and registration are canonical in Validation rules SPI.
SchemaValidationRule¶
See SchemaValidationRule.
SimpleSchemaValidationRule¶
See SimpleSchemaValidationRule.
AuthValidationRule¶
See AuthValidationRule.
RuleValue and composed rules¶
See RuleValue for how rule-generated invalid values are represented.
RuleRegistry¶
RuleRegistry assembles deterministically ordered rule lists and applies ignore filters (default: ManualRuleRegistry). Most extensions should register additional rules via TestGenerationModule rather than implement a custom registry.
TestCaseProvider¶
Test provider interfaces and wiring notes are canonical in Test providers SPI.
ArtifactGenerator¶
Generator interfaces and wiring notes are canonical in Generators SPI.
SecuritySchemeToScope¶
SecuritySchemeToScope pairs a resolved OpenAPI SecurityScheme with its name and scopes. Auth rules and SecurityValueProvider use this model when deriving valid or invalid security values.
Implementation checklist¶
- Deterministic iteration order; no non-deterministic maps/sets.
- No mutation of
TestGenerationContextorOpenAPImodels. - Return empty sequences when a rule/provider is not applicable.
- Set
expectedStatusCodeexplicitly for auth rules. - Wrap provider logic with
runProviderSafely.