Comments (8)
Hi @iliran11
Yeah, so it's an unfortunate occasion because both parameters are flagged as required
but in the description, it actually says "Either an id or screen_name is required for this method".
So it means that you're supposed to provide either and id
or a screen_name
parameter.
But in the twitter-api-spec.yml
, these are both set to required, which is what the UsersShowParams
interface is based on.
There's a way to make a type in TypeScript, that satisfies the constraint that either one of them is provided, but it becomes hard to infer when this type should be used according to the Twitter Docs. And the generators don't yet support this concept, so it'll need to be implemented.
I think it's a great feature for the future, but for now, I think the best solution is to simply make them both optional.
This does allow the consumer to call this endpoint with none of them provided, but if so, an error will be thrown from the Twitter API.
from twitter-api-client.
@iliran11 Yes, totally!
I sent you an invite.
from twitter-api-client.
Hi @lcswillems
Nice catch - thanks for creating an issue!
Will take care of this asap 👍
from twitter-api-client.
This task is up for grabs during Hacktoberfest 🙌
If you want to work on this task, please claim it here in the comments.
Feel free to ask any questions here as well 😊
from twitter-api-client.
@silind, sorry having been direct in my issue, I was coding and discovered this bug so I quickly filled it.
I would like to thank you a lot for your library! It made me save a lot of time with your typings :)
from twitter-api-client.
Hey @lcswillems @silind . Not sure I understood the bug.
On twitter docs, it says the same thing as in the interface:
https://developer.twitter.com/en/docs/twitter-api/v1/accounts-and-users/follow-search-get-users/api-reference/get-users-show
$ curl --request GET
--url 'https://api.twitter.com/1.1/users/show.json?screen_name=twitterdev'
--header 'authorization: Bearer <bearer>'
Can you elaborate more?
from twitter-api-client.
Got it. I can take it too.
@silind, can you make me a collaborator so I can open a branch on this repository? Gonna be more convenient than working on a fork. I'll open PR against the development branch.
from twitter-api-client.
Fixed in v. 1.0.2.
from twitter-api-client.
Related Issues (20)
- 403 on twitter.accountsAndUsers.accountUpdateProfileBanner() HOT 1
- Many methods won't work correctly without `stringify_ids` set to true HOT 1
- twitter-api-client should throw `Error`s, not objects
- `accountsAndUsers.friendshipsNoRetweetsIds()` returns Promise<unknown>
- Cannot use tweetsV2.searchAllTweets
- Using OAuth 2.0 as authorization to log in.
- Installation twitter-api-client HOT 3
- require
- Access token and secret required for pre-access token OAuth 1.0 steps HOT 4
- CORS Error HOT 3
- tweets.statusesHomeTimeline uses wrong StatusesHomeTimeline return type HOT 1
- How to make calls using Bearer token? HOT 1
- Include an example on how to upload an image with a tweet HOT 3
- Support for scheduling tweets HOT 1
- Deno Support
- `oauth_token` is a required parameter for the access_token endpoint HOT 2
- Parameters for TwitterClient.directMessages.eventsNew method is not clear in documentation HOT 1
- Can you edit your biography?
- how to only authenticate a request?
- StatusesHomeTimeline type missing retweeted_status property HOT 1
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 twitter-api-client.