Wrong `UsersShowParams` interface
See original GitHub issueThe current UsersShowParams
is wrong:
export interface UsersShowParams {
/**
* The ID of the user for whom to return results. Either an id or
screen_name is required for this method.
*/
user_id: string | number;
/**
* The screen name of the user for whom to return results. Either
a id or screen_name is required for this method.
*/
screen_name: string;
/**
* The entities node will not be included when set to false.
*/
include_entities?: boolean;
}
It says user_id
or screen_name
is required but both are currently required.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
switch - Display interface - wrong parameter
i've run display interface and it shows wrong parameter. See below. XGE2/0/14 UP 1G(a) F(a) T <SW1>display interface GE2/0/14 ...
Read more >Error trying to use an empty interface parameter for returning ...
I'm using interface{} because I need this parameter to behave like the one in the original . Do call and use a interface{}...
Read more >Allow strict function parameter definitions in interfaces and ...
I would like function parameters declared in an interface (and callbacks) to match its implementation exactly and if not generate a compile ...
Read more >Interface Trip Stop ITS Completes In Error > Stops Processing ...
Scheduled Interface Trip Stop program without any parameters goes in error and the orders are not getting interfaced until running the ITS ...
Read more >PVWA - Getting error "SRAPIE0009 Invalid provider ...
The following error message appears when navigating in the PVWA user interface: image.png. And even panes with no data at all, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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 ascreen_name
parameter. But in thetwitter-api-spec.yml
, these are both set to required, which is what theUsersShowParams
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.
@iliran11 Yes, totally! I sent you an invite.