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

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

Open
tpluscode opened this issue May 13, 2020 · 0 comments

Comments

@tpluscode
Copy link
Contributor

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.

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

No branches or pull requests

1 participant