question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API method name collisions

See original GitHub issue

HTTP method is removed from the beginning of API paths, and this can cause methods to overwrite each other. Example, where only a privateGetOrder will be available, but no privateGetGetOrder.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Deathamnscommented, Jan 28, 2018

One more thing about method naming. Exchanges use a wide range of URL parameter names for the same thing. For example: ticker/:traiding_pair, ticker/:pair, ticker/:coin, ticker/:symbol and so on. How should the library handle these cases? Use a unified name for the same thing, or respect how the exchange named it? In both cases it’s possible to have a collision (URL param is symbol, and there could be a query param with the name symbol), so that should not matter when choosing.

0reactions
kroitorcommented, Jan 28, 2018

One more thing about method naming. Exchanges use a wide range of URL parameter names for the same thing. For example: ticker/:traiding_pair, ticker/:pair, ticker/:coin, ticker/:symbol and so on. How should the library handle these cases? Use a unified name for the same thing, or respect how the exchange named it?

We think preserving them as per exchange is better, because later we could add a swagger-importer or a parser of this kind of format which is common to many exchanges (their API docs) and could make it much easier importing new exchanges later:

GET https://.../markets
POST https://.../trade
GET https://.../order/{id}

The parser should also support other types of brackets around named url params, like in <id> and [id] or :foobar, etc…

If we find some naming that is not consistent with their original schema, we better make the URL listings look as similar as possible to the exchanges’ originals from docs.

In both cases it’s possible to have a collision (URL param is symbol, and there could be a query param with the name symbol), so that should not matter when choosing.

Most of the time we can resolve these types of collisions. but so far we haven’t encountered them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Java - Method name collision in interface implementation
I encountered such a case where a legacy "Address" class implemented Person and Firm interfaces that had a getName() method simply returning a ......
Read more >
Naming conventions | Cloud APIs
In the rare case where an interface name would conflict with another name within the API, a suffix (for example Api or Service...
Read more >
Resolve method's name collisions with controller names #3957
I have a couple of controllers with the same method names in my project. And client contains GetData, GetData2, ..., GetDataN methods after ......
Read more >
Name collision - Wikipedia
In computer programming, a name collision is the nomenclature problem that occurs when the same variable name is used for different things in...
Read more >
Google Objective-C Style Guide | styleguide
Methods can be overridden in subclasses, either deliberately, or accidentally due to naming collisions. When editing a helper method, it may not be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found