Skip to content
New issue

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

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

Already on GitHub? # to your account

Rejected application/vnd.pgrst.object+json returns the media type sucessfully #3373

Closed
steve-chavez opened this issue Apr 3, 2024 · 0 comments · Fixed by #3382
Closed

Rejected application/vnd.pgrst.object+json returns the media type sucessfully #3373

steve-chavez opened this issue Apr 3, 2024 · 0 comments · Fixed by #3382
Assignees
Labels
difficulty: beginner Pure Haskell task

Comments

@steve-chavez
Copy link
Member

Problem

$ postgrest-with-postgresql-16 -f test/spec/fixtures/load.sql postgrest-run

Doing:

curl 'localhost:3000/projects' -H "Accept:  application/vnd.pgrst.object+json" -i

Returns:

HTTP/1.1 406 Not Acceptable
Content-Type: application/json; charset=utf-8
Content-Type: application/vnd.pgrst.object+json; charset=utf-8

{"code":"PGRST116","details":"The result contains 5 rows","hint":null,"message":"JSON object requested, multiple (or no) rows returned"}

It contains the rejected media type and there's even an additional Content-Type.

Solution

Remove application/vnd.pgrst.object+json from the response. All errors should come in application/json.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
difficulty: beginner Pure Haskell task
Development

Successfully merging a pull request may close this issue.

2 participants