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

Output errors as JSON when type is set to json #141

Closed
DenverCoder1 opened this issue Oct 2, 2021 · 3 comments · Fixed by #165
Closed

Output errors as JSON when type is set to json #141

DenverCoder1 opened this issue Oct 2, 2021 · 3 comments · Fixed by #165
Assignees
Labels
beginner-friendly enhancement New feature or request good first issue Good for newcomers

Comments

@DenverCoder1
Copy link
Owner

Currently there is an option to set the output type to JSON to get stats in JSON format.

Example: https://github-readme-streak-stats.herokuapp.com/?user=DenverCoder1&type=json

If there is an error (eg. invalid username, etc.), currently the error card in SVG gets displayed.

It may be best if instead of returning the SVG it echos the response in JSON format, for example:

{
    "error": "User could not be found."
}

Note: It may be advisable to wait for #140 to be merged before starting in order to avoid merge conflicts.

@DenverCoder1 DenverCoder1 added enhancement New feature or request good first issue Good for newcomers beginner-friendly labels Oct 2, 2021
@DenverCoder1 DenverCoder1 added this to To do in GitHub Streak Stats Projects via automation Oct 2, 2021
@menghif
Copy link
Contributor

menghif commented Oct 2, 2021

Hi, I would like to work on this. I can wait for #140 to be merged.

@DenverCoder1
Copy link
Owner Author

@menghif That's great! If you have any questions feel free to ask!

@DenverCoder1
Copy link
Owner Author

@menghif 140 is merged already, feel free to start whenever if you haven't already :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner-friendly enhancement New feature or request good first issue Good for newcomers
Development

Successfully merging a pull request may close this issue.

2 participants