cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
403 stars 134 forks source link

Duplicate operation ids despite excluded tags #222

Closed Toxantron closed 1 year ago

Toxantron commented 2 years ago

In our application we use the method name as the operation id and the controller as tag. Therefor the openapi.json for our application may contain duplicate operation ids, but with different tags. However our config file filters those tags, so they wouldn't be duplicate in the resulting api and even if, they would be in different services.

Is there a way to ignore this or an alternative to define the resulting method name. It would also help if the generator filters by tag first and then evaluates the operations and models afterwards.

Edit: I found in the README that OperationIds need to be uniquie and that x-operation-name can create prettier names. Any chance we could still filter by tag first or at least provide the option to influence method name creation. For example a regex in the config?

Edit2: Okay, I think I can achieve what I want with a custom "operationbody.handlebars" together with a handlebars extension performing the method name generation. Considering how much easiert it is for loopback users, I'd still vote for an alternative.

luisfpg commented 1 year ago

I'm sorry, but we first scan the descriptor, hence, validating the operation id uniqueness, and later on filter.