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

PATCH /things endpoint returns 400 no matter the payload #9

Closed
ivanzy opened this issue Jul 29, 2022 · 1 comment
Closed

PATCH /things endpoint returns 400 no matter the payload #9

ivanzy opened this issue Jul 29, 2022 · 1 comment
Labels
wontfix This will not be worked on work as intended Software is behaving correctly

Comments

@ivanzy
Copy link
Contributor

ivanzy commented Jul 29, 2022

I created a very simple TD and tried to updated it using the PATCH endpoint, but no matter the payload that I added in the PATCH request the server replied was { "type": "/errors/types/bad-request", "title": "Bad Request", "status": 400 }

For reference, the created TD was { "@context": "https://www.w3.org/2019/wot/td/v1", "title": "testTD", "securityDefinitions": { "basic_sc": { "scheme": "basic", "in": "header" } }, "security": "basic_sc" } and the executed PATCH request was curl --request PATCH \ --url http://localhost:3000/things/urn:uuid:1459b300-5388-4dcc-a802-90ebbf1e7e6e \ --header 'authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjksImlhdCI6MTY1OTEwNDM4MywiZXhwIjoxNjU5MTA1MjgzfQ.S7x7_ACToNa_caVE11asTts4xjgwZoQbMupI93FeUrI' \ --header 'content-type: application/json' \ --data '{"@context": "https://www.w3.org/2019/wot/td/v1","title": "update testTD","securityDefinitions": {"basic_sc": {"scheme": "basic","in": "header"}},"security": "basic_sc"}'

@relu91
Copy link
Member

relu91 commented Aug 1, 2022

The specs says to use application/merge-patch+json as content type. Any other type of content type results in a Bad Request. Therefore, this is the correct behavior. Please check the latest version and re-open if you are still experiences issues

@relu91 relu91 closed this as completed Aug 1, 2022
@relu91 relu91 added wontfix This will not be worked on work as intended Software is behaving correctly labels Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on work as intended Software is behaving correctly
Projects
None yet
Development

No branches or pull requests

2 participants