orval-labs / orval

orval is able to generate client with appropriate type-signatures (TypeScript) from any valid OpenAPI v3 or Swagger v2 specification, either in yaml or json formats. 🍺
https://orval.dev
MIT License
3.21k stars 337 forks source link

Hono: incorrect handler relative paths when using tag mode #1573

Closed fredericgrati closed 3 months ago

fredericgrati commented 3 months ago

What are the steps to reproduce this issue?

  1. config file with workspace, mode: 'tags-split' and override.hono.handlers
import { defineConfig } from 'orval';

export default defineConfig({
  petstore: {
    output: {
      mode: 'tags-split',
      workspace: 'generated',
      target: './petstore.ts',
      client: 'hono',
      override: {
        hono: {
          handlers: 'src/handlers',
        },
        zod: {
          strict: {
            response: true,
          },
          preprocess: {
            response: {
              name: 'stripNill',
              path: './src/mutators.ts',
            },
          },
        },
      },
    },
    input: {
      target: './petstore.yaml',
    },
  },
});

What happens?

The handler import in the route generated file is not correct.

import { listPetsHandlers } from '../src/handlers/listPets';

What were you expecting to happen?

The handler import in the route generated file should be:

import { listPetsHandlers } from '../../src/handlers/listPets';

Any logs, error output, etc?

Any other comments?

What versions are you using?

System: OS: macOS 14.4.1 CPU: (10) arm64 Apple M2 Pro Memory: 95.72 MB / 16.00 GB Shell: 5.9 - /bin/zsh