Skip to content

Implicitly fail requests with missing body when operation expects a payload #70

@tpluscode

Description

@tpluscode

It seems repetitive and unnecessary to check the request object every time for the body like

function (req, res) {
  if (!req.dataset) {
    res.send(400)
  }

  // happy path
}

For RDF requests I expect that the operation would be defined as hydra:expects api:SomeClass. I propose to add an implicit check and send a 400 response if the request has no body.

Gotta think how this would affect non-RDF requests. Clearly an application/pdf or a multi-part body would not attach dataset/quadStream so as long as a body exists the request should continue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions