africanlii / liiweb

Drupal-based LII website powering free access to law portals publishing caselaw, legislation, government gazettes and journal articles. Developed by AfricanLII at the University of Cape Town and Laws.Africa
GNU Lesser General Public License v3.0
4 stars 3 forks source link

Error when creating some legislation nodes via API #399

Open longhotsummer opened 3 years ago

longhotsummer commented 3 years ago

The server returns: 422 Client Error: Unprocessable Entity for url: https://lawlibrary.org.za/akn/za-nc/act/p/2012/2/eng@2012-03-28

cristiroma commented 2 years ago

For future reference I'm leaving here a screenshot how I'm debugging the API

_20210916-034804

cristiroma commented 2 years ago

I did a small improvement here to expose the underlying error when API call fails.

_20210916-074426

longhotsummer commented 2 years ago

Looks like you have made some progress here, Cristian. Here's the error message we get:

{"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http:\/\/jsonapi.org\/format\/1.0\/"}}}},"errors":[{"title":"Unprocessable Entity","status":"422","detail":"Unprocessable Entity: validation failed.","links":{"via":{"href":"http:\/\/lawlibrary.org.za\/akn\/za\/act\/gn\/2013\/921\/eng@2013-11-29"}}}]}
cristiroma commented 2 years ago

@longhotsummer do you think it would be possible to add this to one of the instances so we can have more details about the underlying error?

longhotsummer commented 2 years ago

Sure, Roger can assist. I'll follow up in slack.