You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have an OpenAPI server based on Python Connexion (https://github.com/zalando/connexion). Since this is a Python module the operationId fields take the form of "package_name.api.module_name.method". For example, the operationId for the "/users" GET operation will be "my_server.api.users.get".
As a result, the Go code generator will create an service called UsersApiService that will have a method called MyServerApiUsersGet. To me, this name has a lot of unneeded sections. The Python package name is obviously not needed, the word Api is not needed and also the Service name is not needed since the method is already inside a service with that name. So, instead, I would like to have the method be just "get".
Please do not focus on this specific "GET" operation, the naming could be anything.
Describe the solution you'd like
Today, the code generator allows removing the prefix, but it assumes the delimiter is an underscore and takes everything after the first one. In my case, the delimiter is a period and I would like to get everything after the last one.
So, I would like to suggest broadening this option by adding two configuration fields:
Delimiter - allowing the user to choose which delimiter to use. The default should be underscore
Count - The X occurrence of the delimiter that constitutes a prefix. The default should be 1 and -1 should be used for last
Describe alternatives you've considered
I saw your comment about using templates. But, since this change relates to all languages, I think my suggestion is the way to go
The text was updated successfully, but these errors were encountered:
Add new configuration flags: REMOVE_OPERATION_ID_PREFIX_DELIMITER and REMOVE_OPERATION_ID_PREFIX_COUNT
Add the corresponding fields in the DefaultCodegen
Sanitize the operationId according to the new fields
Add delimiter to list of nonNameElementPattern
Add unit test
Add new configuration flags: REMOVE_OPERATION_ID_PREFIX_DELIMITER and REMOVE_OPERATION_ID_PREFIX_COUNT
Add the corresponding fields in the DefaultCodegen
Sanitize the operationId according to the new fields
Add delimiter to list of nonNameElementPattern
Add unit test
Is your feature request related to a problem? Please describe.
I have an OpenAPI server based on Python Connexion (https://github.com/zalando/connexion). Since this is a Python module the operationId fields take the form of "package_name.api.module_name.method". For example, the operationId for the "/users" GET operation will be "my_server.api.users.get".
As a result, the Go code generator will create an service called UsersApiService that will have a method called MyServerApiUsersGet. To me, this name has a lot of unneeded sections. The Python package name is obviously not needed, the word Api is not needed and also the Service name is not needed since the method is already inside a service with that name. So, instead, I would like to have the method be just "get".
Please do not focus on this specific "GET" operation, the naming could be anything.
Describe the solution you'd like
Today, the code generator allows removing the prefix, but it assumes the delimiter is an underscore and takes everything after the first one. In my case, the delimiter is a period and I would like to get everything after the last one.
So, I would like to suggest broadening this option by adding two configuration fields:
Describe alternatives you've considered
I saw your comment about using templates. But, since this change relates to all languages, I think my suggestion is the way to go
The text was updated successfully, but these errors were encountered: