Laevitas / laevitas-feature-issue-tracker

4 stars 0 forks source link

Duplicate method names for 3 API endpoints #4

Closed joemccann closed 1 year ago

joemccann commented 1 year ago

If you call catalog() and create an array of all the methodNames in the array that is returned for api_list there are three duplicate method names for different endpoints (6 total endpoints):

1st duplicate:

//
// API Endpoint #46
// @description Retrieve Perpetual Funding Data
// @methodName getPerpetualFundingData
// api_path = /analytics/futures/perpetual_funding/{currency}
//
//
// API Endpoint #53
// @description Retrieve Perpetual Funding Data for a Specific Currency and Type
// @methodName getPerpetualFundingData
// api_path = /analytics/futures/perpetual_funding/{currency}/{type}
//

Recommendation: change the method with the description "Retrieve Perpetual Funding Data for a Specific Currency and Type" to getPerpetualFundingDataWithType.

2nd duplicate:

//
// API Endpoint #59
// @description DOVs Weekly Auctions
// @methodName dovs
// api_path = /analytics/defi/dovs
//
//
// API Endpoint #83
// @description Historical DOVs Weekly Auctions
// @methodName dovs
// api_path = /historical/defi/dovs/auctions/{protocol}
//

Recommendation: change the method with the description "Historical DOVs Weekly Auctions" to dovsHistorical.

3rd duplicate:

//
// API Endpoint #122
// @description Retrieve Historical Futures Open Interest Weighted Volume Funding for a Specific Currency
// @methodName getFuturesOIWeightedVolumeFunding
// api_path = /historical/futures/oi_weighted_volume_funding/{currency}
//
//
// API Endpoint #123
// @description Retrieve Historical Futures Open Interest Weighted Basis for a Specific Currency
// @methodName getFuturesOIWeightedVolumeFunding
// api_path = /historical/futures/oi_weighted_basis/{currency}
//

Recommendation: change the method with the description "Retrieve Historical Futures Open Interest Weighted Basis for a Specific Currency" to getFuturesOIWeightedBasisFunding.

MoetezL commented 1 year ago

Issue #4 has been resolved. The catalog() function has been updated to eliminate duplicate method names for different endpoints. Now, the array returned by api_list contains only unique method names representing all endpoints. Thank you for bringing this to our attention!

joemccann commented 1 year ago

I'd also recommend running some tests against your API as you add methods and also considering "pinning" the version of the API so end users can rely on the API being fixed/deterministic.