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.

Wrong `UsersShowParams` interface

See original GitHub issue

The 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:closed
  • Created 3 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
SimonHoibergcommented, Oct 3, 2020

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.

1reaction
SimonHoibergcommented, Oct 3, 2020

@iliran11 Yes, totally! I sent you an invite.

Read more comments on GitHub >

github_iconTop 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 >

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