Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear suffix naming convention with duplicate operation ID's #192

Open
marcrd opened this issue Sep 20, 2017 · 4 comments
Open

Unclear suffix naming convention with duplicate operation ID's #192

marcrd opened this issue Sep 20, 2017 · 4 comments

Comments

@marcrd
Copy link

marcrd commented Sep 20, 2017

In #186, it was changed so if you have duplicate operation ID's, the library appends numeric suffixes using _1, _2, etc.

These numerically suffixed methods don't provide much context to the caller. I'd propose appending the path parameters to the method name, so as to make it unique with the parameter context.

For example, let's say you had multiple operation ID's of ListAggregatedUsers, with different path parameters. Instead of the numerically generated suffixes, append that URL parameters of say resourceID to the operation ID for the client. So instead of:

ListAggregatedUsers_1

Becomes:

ListAggregatedUsersWithResourceId
@marcrd
Copy link
Author

marcrd commented Nov 8, 2017

Bumping this

@HawkeyePierce89
Copy link

Yes, it's bad solution :( And this works wihtout reference to ID's, just in the order of methods in Swagger

@HawkeyePierce89
Copy link

How a temporary solution you can use getPathToMethodName(opts, m, path)) instead var methodName = (op.operationId ? normalizeName(op.operationId) : getPathToMethodName(opts, m, path));

@marcrd
Copy link
Author

marcrd commented Feb 12, 2018

How a temporary solution you can use getPathToMethodName(opts, m, path)) instead var methodName = (op.operationId ? normalizeName(op.operationId) : getPathToMethodName(opts, m, path));

That's a good idea, I'll give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants