Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type for GiphyAPI ... /gifs/random #2

Open
regisfrias opened this issue Apr 7, 2018 · 1 comment
Open

Wrong type for GiphyAPI ... /gifs/random #2

regisfrias opened this issue Apr 7, 2018 · 1 comment

Comments

@regisfrias
Copy link

It seems to me that data: GIFObject[] should be data: GIFObject instead for /gifs/random

  '/gifs/random': {
    GET: {
      query: {
        api_key: string
        tag?: string
        rating?: string
        fmt?: string
      }
      response: {
        data: GIFObject[] <=========
        meta: MetaObject
      }
    }
}

Here:
https://github.com/rawrmaan/restyped-giphy-api/blob/master/giphy-api.d.ts

@swenmeeuwes
Copy link

For now we can assert the correct type by casting it:
<GIFObject>(response.data.data as any)

But it would be nice if these typings were updated 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants