Comments (4)
I don't like option E, because if the user wants to call an endpoint that doesn't require the market
parameter at best they'll have to choose a random dummy value (which adds unnecessary extra code) and at worst they'll get confused and spend time getting a proper value.
I think that approach F is too complex. Even if we had macros that made it easy to implement, it basically doubles the size of the library, it's not worth it.
Approach G is too limited; it doesn't allow for users to have different markets for different queries. We don't want to force the user to have multiple clients, ever.
Between options A and B I don't have a preference, they both work. I don't think it matters which one is chosen.
PS: what happened to options C and D?
from rspotify.
Ooh, the letters came from your blog post. I didn't realize that and got really confused why two letters were skipped :P.
from rspotify.
The thing with E is that if the endpoint doesn't need the parameter it doesn't have to be specified. Its value will only be used for endpoints that require it. But yeah, I'm skeptical about it as well.
C and D seemed too basic to me and not exactly what we want. Of course, they can also be discussed. The main issue is that we'd need to declare both a function and a struct, and the user would have to import both of them as well, and with so many endpoints and so little of them with the exact same parameters I'm not sure if it's the most appropiate choice.
from rspotify.
After working a bit on #201 and working with function signatures, I've come to the conclusion that using so many unnecessary generic parameters with Into<Option<T>>
is a mess. If anything I'd go for the simplest; option A.
Once #201 is done we'll get rid of the majority of optional parameters anyway, since when using iterators limit
or offset
don't need to be passed, so this should be less of a problem. The wonderful part about iterators is that the user can just use .take()
or .take_while()
, which won't cause unnecessary requests and can work as a limit
.
from rspotify.
Related Issues (20)
- Client method to sync playlist content efficiently using multible api calls. HOT 2
- Auth code flow, redirect server. HOT 2
- 0.11.17 breaks PKCE auth HOT 1
- `tracks_features` breaks on deserialization when a track is requested that doesn't have audio features HOT 1
- Missing market field on the album API call HOT 1
- Yank version 0.11.7 from crates.io HOT 3
- Is Add Custom Playlist Cover Image request implemented ? HOT 2
- json parse error: unknown variant `Smartwatch`
- Route `/v1/shows/{id}` requires market query parameter but `get_a_show` market parameter is `Option` HOT 2
- queryArtistOverview / artist stats (monthly listeners) HOT 2
- AuthCodeSpotify with token and refresh HOT 2
- Incorrect url in OAuthClient documentation HOT 1
- json parse error when calling `artist` method HOT 24
- json parse error when getting playlist with no image HOT 20
- SimplifiedAlbum added onto SimplifiedTrack Struct
- Release a new version HOT 2
- Getting bad request error(400)
- Not able to get playlist, when reading token from a file HOT 1
- JSON parsing error when fetching a playlist with user's own local track
- Update the examples HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rspotify.