Skip to content

Incorrect server response to a POST with an incorrect request body  #1

Description

@NadiyaDyka

Send request POST: https://jsonapiplayground.reyesoft.com/v2/chapters
Body: {
"type": "chapters",
"id": "111",
"attributes": {
"title": "Chapter 2777",
"ordering": 7167677
}
}
Expected response (according to JSON API specification): A document MUST contain at least one of the following top-level members:
data: the document’s “primary data”
errors: an array of error objects
meta: a meta object that contains non-standard meta-information.
The members data and errors MUST NOT coexist in the same document.

Received response: A JSON object MUST be at the root of every JSON API request and response containing data
{
"errors": [
{
"code": "wrong_data",
"title": "Wrong data received.",
"detail": "A JSON object MUST be at the root of every JSON API request and response containing data"
}
]
}
There is an object at the root of the JSON, but it does not have the required members - data, error or meta.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions