Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Content negotiation API does not work #249

Closed
ezimuel opened this issue Jan 26, 2015 · 0 comments
Closed

Content negotiation API does not work #249

ezimuel opened this issue Jan 26, 2015 · 0 comments
Labels

Comments

@ezimuel
Copy link
Contributor

ezimuel commented Jan 26, 2015

The content negotiation API /apigility/api/content-negotiation is not working. If you try to create a new selector you will get the 422 error, reporting the message "Class name (content_name) does not exist":

Request:

POST /apigility/api/content-negotiation
{ "content_name" : "Test" }

Response:

{"validation_messages":{"content_name":["Class name (content_name) does not exist"]},"type":"http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html","title":"Unprocessable Entity","status":422,"detail":"Failed Validation"}

Even if you try to create a new selector with some new models you get the same error.
I also tried to send PATCH call and I get the 400 error "Unrecognized field ...".
I think the issue is in the InputFilter: ZF\Apigility\Admin\InputFilter\ContentNegotiation

@ezimuel ezimuel added the bug label Jan 26, 2015
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this issue Jan 26, 2015
The ContentNegotiationInputFilter was not validating the `content_name`
key correctly, leading to invalidation of submitted data. The proposed
change fixes it.
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this issue Jan 26, 2015
POST is the only one that should allow `content_name` in the payload; otherwise,
we're using PATCH or DELETE with the `content_name` in the URI. As such, this
means two input filters.

This patch creates CreateContentNegotiationInputFilter, which extends
ContentNegotiationInputFilterTest and ensures that `content_name` is present.
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this issue Jan 26, 2015
The ContentNegotiationInputFilter was not validating the `content_name`
key correctly, leading to invalidation of submitted data. The proposed
change fixes it.
weierophinney added a commit to weierophinney/zf-apigility-admin that referenced this issue Jan 26, 2015
POST is the only one that should allow `content_name` in the payload; otherwise,
we're using PATCH or DELETE with the `content_name` in the URI. As such, this
means two input filters.

This patch creates CreateContentNegotiationInputFilter, which extends
ContentNegotiationInputFilterTest and ensures that `content_name` is present.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant