Skip to content

Comments

fix: respect single schema file configuration in import generation#2752

Draft
StandardGage wants to merge 1 commit intoorval-labs:masterfrom
StandardGage:master
Draft

fix: respect single schema file configuration in import generation#2752
StandardGage wants to merge 1 commit intoorval-labs:masterfrom
StandardGage:master

Conversation

@StandardGage
Copy link

@StandardGage StandardGage commented Jan 15, 2026

Problem

When using Orval with a configuration that outputs all schemas to a single file, the generated controller files were importing types from non-existent individual schema file paths.

For example, instead of:

import type { ActionTypeRequest, GetDeliveryCardParams } from '../orchestrator.schemas';

It was generating:

import type { ActionTypeRequest } from '../orchestrator.schemas/actionTypeRequest';
import type { GetDeliveryCardParams } from '../orchestrator.schemas/getDeliveryCardParams';

This caused TypeScript errors: Cannot find module '../orchestrator.schemas/actionTypeRequest'

Solution

Modified generateImportsForBuilder() to detect when schemas are configured as a single file and treat them the same way as index files - importing all types from the single schema file

@melloware melloware added this to the 8.0.1 milestone Jan 15, 2026
@melloware melloware added the bug Something isn't working label Jan 15, 2026
@melloware
Copy link
Collaborator

Looks like the tests are failing

Copy link
Collaborator

@melloware melloware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any update on this?

@melloware melloware modified the milestones: 8.0.1, 8.0.2, FUTURE Jan 16, 2026
@melloware melloware marked this pull request as draft January 19, 2026 16:31
@StandardGage
Copy link
Author

all of the tests are passing for me locally, it looks like an import issue?

@melloware
Copy link
Collaborator

Running build now

@melloware
Copy link
Collaborator

hmmm tests still failing

@melloware
Copy link
Collaborator

looks like it is this specific test schemas-zod-only

schemas-zod-only - Your OpenAPI spec has been converted into ready to use orval!
Error: generated/default/no-index-files/endpoints.ts(15,8): error TS2307: Cannot find module './model' or its corresponding type declarations.
Error: generated/fetch/zod-schema-response-split/endpoints.ts(15,8): error TS2307: Cannot find module './model/index.zod' or its corresponding type declarations.
Error: Process completed with exit code 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants