Problem
Orval 8.16.0 generates mock factory signatures that reference strict mock helper types (MockWithNullableOverrides, {Schema}Mock, etc.) but does not emit the corresponding export type declarations when all of the following are combined:
This produces TypeScript errors such as:
error TS2304: Cannot find name 'MockWithNullableOverrides'.
error TS2304: Cannot find name 'PetMock'.
error TS2552: Cannot find name 'getPetMock'. Did you mean 'getGetPetsResponseMock'?
Why existing tests do not catch it
Strict-mock fixtures (issue-3525, issue-3525-multi, etc.) use client: 'fetch' and a single-file / non-tags-split layout. They do not cover tags-split per-tag .msw.ts + .faker.ts with arrayItems: true.
In that layout, strictMockSchemaTypeNames was dropped when building tag targets, so finalizeMockImplementation / dedupeStrictMockTypeDeclarations never prepended strict types. Faker files also referenced schema factories emitted only in the MSW file because array-item factory dedup was scoped per tag but not per mock generator file.
Expected behavior
Each generated mock file that references strict mock types should include (once per file):
export type KeysWithNull<O> = { ... };
export type MockWithNullableOverrides<...> = ...;
export type PetMock = { [K in keyof Required<Pet>]: NonNullable<Required<Pet>[K]>; };
Faker files must define or import schema factories they call (e.g. getPetMock()).
Related PRs
Problem
Orval 8.16.0 generates mock factory signatures that reference strict mock helper types (
MockWithNullableOverrides,{Schema}Mock, etc.) but does not emit the correspondingexport typedeclarations when all of the following are combined:output.mode: 'tags-split'override.mock.required: trueandoverride.mock.nonNullable: true(strict mock mode, feat(mock): emit strict Mock return types when required and nonNullable are both true #3529)mock.generators: [{ type: 'msw' }, { type: 'faker', arrayItems: true }]mock.indexMockFiles: trueThis produces TypeScript errors such as:
Why existing tests do not catch it
Strict-mock fixtures (
issue-3525,issue-3525-multi, etc.) useclient: 'fetch'and a single-file / non-tags-split layout. They do not cover tags-split per-tag.msw.ts+.faker.tswitharrayItems: true.In that layout,
strictMockSchemaTypeNameswas dropped when building tag targets, sofinalizeMockImplementation/dedupeStrictMockTypeDeclarationsnever prepended strict types. Faker files also referenced schema factories emitted only in the MSW file because array-item factory dedup was scoped per tag but not per mock generator file.Expected behavior
Each generated mock file that references strict mock types should include (once per file):
export type KeysWithNull<O> = { ... };export type MockWithNullableOverrides<...> = ...;export type PetMock = { [K in keyof Required<Pet>]: NonNullable<Required<Pet>[K]>; };Faker files must define or import schema factories they call (e.g.
getPetMock()).Related PRs
required+nonNullableare both truestrictMockSchemaTypeNames/finalizeMockImplementation