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

Extend input filter option to exclude endpoints #1676

Closed jbcam closed 2 weeks ago

jbcam commented 3 weeks ago

What are the steps to reproduce this issue?

  1. Attempt to configure several clients using the current configuration options, eg:
  1. Try to exclude endpoints containing tag1 using the existing regex filter #835
    filters: {
        tags: [/^(?!tag1$).*/], 
    }

What happens?

While this configuration might work using negative regex patterns, it fails when an endpoint has multiple tags.

What were you expecting to happen?

It would be helpful to introduce a more straightforward way to exclude tags (or combine exclusion and inclusion), such as:

        input: {
          target: 'xxx',
          filter: {
             mode: 'include' | 'exclude', // default 'include'
            tags: ['tag1'],
          }
        }

This enhancement would make the filtering feature more intuitive and flexible.

What versions are you using?

Package Version: 7.1.1