cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
397 stars 132 forks source link

Duplicate operationId #323

Closed marcschroeder closed 4 months ago

marcschroeder commented 4 months ago

Currently it is not possible to generate multiple operations using the same operationId. While this follows the OpenAPI spec - https://swagger.io/specification/ - this prevents different services to have the same method e.g. "list" or "create" even though this might make sense. To ensure uniqueness a number is added to none-unique operations at the moment.

Would a PR be accepted that adds a new command line parameter to disable this behavior? This would allow to generate easier to read implementations.

luisfpg commented 4 months ago

You can try using the x-operation-name vendor extension. Check the project readme.

Em sáb., 1 de jun. de 2024, 10:20, Marc Schröder @.***> escreveu:

Currently it is not possible to generate multiple operations using the same operationId. While this follows the OpenAPI spec - https://swagger.io/specification/ - this prevents different services to have the same method e.g. "list" or "create" even though this might make sense. To ensure uniqueness a number is added to none-unique operations at the moment.

Would a PR be accepted that adds a new command line parameter to disable this behavior? This would allow to generate easier to read implementations.

— Reply to this email directly, view it on GitHub https://github.com/cyclosproject/ng-openapi-gen/issues/323, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJA76NZOSLM4YCMZQOH723ZFHDBRAVCNFSM6AAAAABIUFBG6OVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMZDSMJUGMZTKOI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

marcschroeder commented 4 months ago

I will try that thanks!