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

Docs: type of Response missing the second type var #179

Closed
mattibo opened this issue Jan 9, 2025 · 1 comment · Fixed by #180
Closed

Docs: type of Response missing the second type var #179

mattibo opened this issue Jan 9, 2025 · 1 comment · Fixed by #180
Labels
documentation Improvements or additions to documentation

Comments

@mattibo
Copy link

mattibo commented Jan 9, 2025

Summary

With the change in #173 the type of response has changed.

The README and the documentation were not updated.

This part

resp: Response[FullRepository] = github.rest.repos.get("owner", "repo")

should look like

resp: Response[FullRepository, FullRepositoryType] = github.rest.repos.get("owner", "repo") 

Affected files

  • README.md
  • docs/usage/rest-api.md
  • docs/usage/unit-test.md
@yanyongyu
Copy link
Owner

yanyongyu commented Jan 9, 2025

The change is actually in #158 . The second type var of the Response type is optional and only takes effects when using response.json(). It is Any by default. In the docs, the code is for readers to inspect the type only. But the example for response.json() uses the wrong type, I will fix it.

@yanyongyu yanyongyu added the documentation Improvements or additions to documentation label Jan 9, 2025
@yanyongyu yanyongyu changed the title type of Response wrong in README and documentation Docs: type of Response missing the second type var Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants