feat: add example validation and mismatch reporting for OpenAPI schemas

This commit is contained in:
2026-03-27 15:27:03 +01:00
parent aab9bf01bb
commit e0446d4939
7 changed files with 261 additions and 10 deletions

View File

@@ -28,6 +28,19 @@ export interface TagDetail {
endpoints: number;
}
/**
* A single example/type mismatch detected during mock generation.
*/
export interface ExampleMismatchEntry {
schemaName: string;
propertyName: string;
declaredType: string;
exampleValue: unknown;
exampleJsType: string;
action: 'coerced' | 'ignored';
coercedValue?: unknown;
}
/**
* Final generation report persisted as `generation-report.json`.
*/
@@ -38,6 +51,10 @@ export interface GenerationReport {
tagDetails: TagDetail[];
outputDirectory: string;
linting: LintResult;
warnings: {
exampleMismatches: ExampleMismatchEntry[];
total: number;
};
structure: {
dtos: number;
repositories: number;