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

when sending an empty array to an endpoint the returned error is not clear #519

Open
criskell opened this issue Jul 4, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@criskell
Copy link
Contributor

criskell commented Jul 4, 2023

When POSTing to an endpoint having the payload as an empty array, the error property of the response contains an error that is not clear where the caller went wrong, it just sends what looks like an error from some internal library.

Example request

curl -X POST 'https://api.openpix.com.br/api/v1/charge' --header "Authorization: $APP_ID" --header 'Content-Type: application/json' --data-raw '[]' && echo

image

Example request with a clear error

curl -X POST 'https://api.openpix.com.br/api/v1/charge' --header "Authorization: $APP_ID" --header 'Content-Type: application/json' --data-raw '{"value": 100}' && echo

image

@criskell criskell added the bug Something isn't working label Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant