orval icon indicating copy to clipboard operation
orval copied to clipboard

Bug: endpoints with multiple tags get generated and exposed multiple times

Open ThijsBroersen opened this issue 1 year ago • 1 comments

When having an endpoint definition with multiple tags this endpoint wil get generated multiple times with the mode: 'tags' (or 'tags-split'), this causes the index.ts to not compile because it gets exposed multiple times.

What perhaps would work is to use all the tags, in the order they appear in the spec, to determine the path the endpoint files should be in. E.g. an endpoint with "tags" : ["Animal", "Cat"] should then be generated in ./animal/cat and exposed once instead of both in ./animal and ./cat and exposed twice. Additionally, with an index file at every level, one has more precise import scopes.

ThijsBroersen avatar May 24 '23 15:05 ThijsBroersen

I'm facing the same issue, to add on this enhancement, I have some openapi paths like /organizations/{orgaId}/members and ideally I want to have a folder structure to have queries related to organizations in src/endpoints/organizations/organizations.ts and the related subqueries for members in src/endpoints/organizations/members/members.ts and if we could also have a index.ts for those would be awesome.

HugoPoi avatar Mar 21 '24 15:03 HugoPoi