Giter Club home page Giter Club logo

Comments (8)

SimonHoiberg avatar SimonHoiberg commented on May 28, 2024 3

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.

SimonHoiberg avatar SimonHoiberg commented on May 28, 2024 1

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

from twitter-api-client.

SimonHoiberg avatar SimonHoiberg commented on May 28, 2024

Hi @lcswillems
Nice catch - thanks for creating an issue!

Will take care of this asap 👍

from twitter-api-client.

SimonHoiberg avatar SimonHoiberg commented on May 28, 2024

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.

lcswillems avatar lcswillems commented on May 28, 2024

@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.

iliran11 avatar iliran11 commented on May 28, 2024

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.

iliran11 avatar iliran11 commented on May 28, 2024

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.

SimonHoiberg avatar SimonHoiberg commented on May 28, 2024

Fixed in v. 1.0.2.

from twitter-api-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.