{"action":"created","issue":{"url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/107","labels_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/107/labels{/name}","comments_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/107/comments","events_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/107/events","html_url":"https://github.com/django-json-api/django-rest-framework-json-api/issues/107","id":108283215,"number":107,"title":"Confusing validation error when submitting JSON in Django REST API format","user":{"login":"ncoghlan","id":1026649,"avatar_url":"https://avatars.githubusercontent.com/u/1026649?v=3","gravatar_id":"","url":"https://api.github.com/users/ncoghlan","html_url":"https://github.com/ncoghlan","followers_url":"https://api.github.com/users/ncoghlan/followers","following_url":"https://api.github.com/users/ncoghlan/following{/other_user}","gists_url":"https://api.github.com/users/ncoghlan/gists{/gist_id}","starred_url":"https://api.github.com/users/ncoghlan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncoghlan/subscriptions","organizations_url":"https://api.github.com/users/ncoghlan/orgs","repos_url":"https://api.github.com/users/ncoghlan/repos","events_url":"https://api.github.com/users/ncoghlan/events{/privacy}","received_events_url":"https://api.github.com/users/ncoghlan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-25T08:21:55Z","updated_at":"2015-09-25T13:22:34Z","closed_at":null,"body":"Thanks for creating this project! I really like both Django REST Framework and the design of jsonapi.org, so being able to use them together is excellent.\r\n\r\nHowever, with the current 2.0.0a2 release, I found an interesting problem with the interaction between DRFJA's validation errors, and DRF's presentation of those errors through the browsable API: https://github.com/tomchristie/django-rest-framework/issues/3446\r\n\r\nWhat appears to be happening is that when a create request is submitted using DRF's default format (i.e. an attribute mapping at the top level of the JSON request), DRFJA is raising ValidationError with the details attribute set to a list, which DRF then attempts to treat as a mapping.\r\n\r\nAssuming I've identified the origins of the error correctly, If the exception details stored a mapping instead, that could both report the field name that was expected, as well as avoid the secondary failure in DRF's error handling."},"comment":{"url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/comments/143219722","html_url":"https://github.com/django-json-api/django-rest-framework-json-api/issues/107#issuecomment-143219722","issue_url":"https://api.github.com/repos/django-json-api/django-rest-framework-json-api/issues/107","id":143219722,"user":{"login":"jerel","id":322706,"avatar_url":"https://avatars.githubusercontent.com/u/322706?v=3","gravatar_id":"","url":"https://api.github.com/users/jerel","html_url":"https://github.com/jerel","followers_url":"https://api.github.com/users/jerel/followers","following_url":"https://api.github.com/users/jerel/following{/other_user}","gists_url":"https://api.github.com/users/jerel/gists{/gist_id}","starred_url":"https://api.github.com/users/jerel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerel/subscriptions","organizations_url":"https://api.github.com/users/jerel/orgs","repos_url":"https://api.github.com/users/jerel/repos","events_url":"https://api.github.com/users/jerel/events{/privacy}","received_events_url":"https://api.github.com/users/jerel/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T13:22:34Z","updated_at":"2015-09-25T13:22:34Z","body":"I also just tagged alpha-3 so you can update to that tag if you like. To install the develop branch you can install with pip like so `-e git+https://github.com/django-json-api/django-rest-framework-json-api.git@develop#egg=django-json-api`"}}