cyclosproject / ng-openapi-gen

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

Support x-operation-name extension #30

Closed exejutable closed 4 years ago

exejutable commented 5 years ago

Today if the operationId is repeated add a suffix to the name for example:

users:
    get:
        operationId: find
        tags:
            - users
organizations:
    get:
        operationId: find
        tags:
            - organizations

this create two services users with the method find and the service organizations with the method find_1. Maybe we can change this to make the combination of tag and operationId unique to prevent the suffix in this cases?

luisfpg commented 5 years ago

This won't be implemented, because the OpenAPI specification says:

operationId is an optional unique string used to identify an operation. If provided, these IDs must be unique among all operations described in your API.

Alternatively, we can add support for x-operation-name from Loopback. Would that be an option?

exejutable commented 5 years ago

I see, okey we can go for the second one, add funtionality. I check the doc of openapi , we can extend the spec respecting the rules they propose.