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.2k stars 337 forks source link

Using tag filters with `split` and `single` mode generates empty files with only the header comment #1691

Open DefCon-007 opened 2 weeks ago

DefCon-007 commented 2 weeks ago

What are the steps to reproduce this issue?

Try to convert a schema with an invalid tag filter and split or single mode.

Use the following config for Orval.

module.exports = {
    petstore: {
      input: {target: '<PATH TO SCHEMA>, 
      filters: {
        tags: ['invalid-tag']
      }},

      output: {
        mode: 'single',
        client: 'axios',
      }
    },
  };

What happens?

An empty file is generated with only the header comment.

What were you expecting to happen?

No file should be generated as it happens when using the tags mode with a invalid tag.

Any logs, error output, etc?

Any other comments?

What versions are you using?

  System:
    OS: macOS 15.1
    CPU: (14) arm64 Apple M3 Max
    Memory: 150.47 MB / 36.00 GB
    Shell: 5.9 - /bin/zsh