Skip to content

runtimeConfigPath is copied verbatim instead of being resolved relative to generated output #3394

@roiceee

Description

@roiceee

Description

Package: @hey-api/openapi-ts
Plugin: @hey-api/client-axios

Description

When using runtimeConfigPath with @hey-api/client-axios, the value is copied verbatim into the generated client files.

This causes incorrect imports unless the path is manually written relative to the generated output directory.

openapi-ts.config.ts:

import { defineConfig } from '@hey-api/openapi-ts';
import 'dotenv/config';

export default defineConfig([
  {
    input: `./schema1.json`,
    output: 'src/client/schema1',
    plugins: [
      '@hey-api/schemas',
      '@hey-api/sdk',
      '@hey-api/typescript',
      {
        name: '@hey-api/client-axios',
        runtimeConfigPath: './src/client/config/schema1.config.ts',
      },
    ],
  },
  {
    input: `./schema2.json`,
    output: 'src/client/schema2',
    plugins: [
      '@hey-api/schemas',
      '@hey-api/sdk',
      '@hey-api/typescript',
      {
        name: '@hey-api/client-axios',
        runtimeConfigPath: './src/client/config/schema2.config.ts',
      },
    ],
  },
]);

Generated Schema 1
import { createClientConfig } from './src/client/config/schema1.config.ts';

Generated Schema 2
import { createClientConfig } from './src/client/config/schema2.config.ts';

Reproducible example or configuration

https://stackblitz.com/edit/stackblitz-starters-z1bxoxgw?file=src%2Fclient%2Fschema1%2Fclient.gen.ts

OpenAPI specification (optional)

No response

System information (optional)

No response

Metadata

Metadata

Labels

bug 🔥Broken or incorrect behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions