orval icon indicating copy to clipboard operation
orval copied to clipboard

Zod: Components override not working

Open Arnagos opened this issue 1 year ago • 3 comments

What are the steps to reproduce this issue?

  1. Generate with the following settings
  Validators: {
    input: { target: './swagger.json' },
    output: {
      mode: 'tags',
      target: 'src/schemas/api',
      client: 'zod',
      indexFiles: false,
      prettier: true,
      override: {
        components: {
          responses: { suffix: 'ResponseSchema' },
          parameters: { suffix: 'ParamsSchema' },
          requestBodies: { suffix: 'BodiesSchema' }
        }
      }
    }

What happens?

The suffix overrides defined are not respected. Instead of i.e. ***ResponseSchema I still get ***Response.

What were you expecting to happen?

I expect the override to be respected.

Any logs, error output, etc

None

Any other comments?

What versions are you using?

Operating System: Windows 11 Package Version: 6.26.0 Browser Version: n/a

Arnagos avatar Apr 05 '24 12:04 Arnagos

it's not exactly the same since on zod we don't handle the schemas with the components section but directly on each path. We could add an option to do it with zod too.

anymaniax avatar Apr 11 '24 13:04 anymaniax

Hi @anymaniax . I'm having the same issue as OP.

Is there any way to do this currently? I would really like to end my zod schemas with "Schema"

pauloendoh avatar Oct 04 '24 01:10 pauloendoh