Add support for 422 Unprocessable Entity

Description

Add http status code "422 Unprocessable Entity" to indicate that (COMPOSITION) content is cannot be validated as underlying template is missing - see also https://openehr.atlassian.net/browse/SPECPR-298

:
I think I agree with this "The 422 (Unprocessable Entity) status code means the server understands the content type of the request entity (hence a 415(Unsupported Media Type) status code is inappropriate), and the syntax of the request entity is correct (thus a 400 (Bad Request) status code is inappropriate) but was unable to process the contained instructions." and goes in the same direction as your proposal @sebastian.iancu
Sebastian Iancu 2 months ago
Thanks @pablo.pazos , I guess such change we should introduce in v1.1? Currently 400 is also used for these kind of errors that I think should be 422 - would it be than a breaking change?

Activity

Show:
Sebastian Iancu
September 10, 2019, 10:10 AM

Sebastian Iancu 2 months ago
Thanks @pablo.pazos , I guess such change we should introduce in v1.1? Currently 400 is also used for these kind of errors that I think should be 422 - would it be than a breaking change?
Pablo Pazos 2 months ago
I'm not sure about versioning, I'm not following the current versioned baseline on jira
Pablo Pazos 2 months ago
about the breaking, I don't think would break current implementations, some that I was able to test currently have a 500 error when the OPT doesnt exist :stuck_out_tongue:
Sebastian Iancu 2 months ago
Currently we have release 1.0.0 since 2017 and we work now on releasing 1.0.1. After that we’ll start working on 1.1 and add few more missing endpoints and resources and other stuff
Pablo Pazos 2 months ago
Ok, I think this is important to have ASAP, if it can be added to 1.0.1 will be better
Pablo Pazos 2 months ago
having commits for OPTs that don't exist is pretty common and IMO should be explicitly validated and feedback from the API should be clear about that specific error
Sebastian Iancu 2 months ago
I get your concern; to some extent I also changed (in 1.0.1) the description of 400 to temporarily cover cases you mentioned, and my plan was to introduce 422 later (in v 1.1) as a refinement of content error. In my opinion, if we would like to properly follow versioning policy, we need to do this in v1.1
:+1:
1
Pablo Pazos 2 months ago
@sebastian.iancu that's OK for me, just needed an explicit error reporting from the server under this specific case

Thomas Beale 1 month ago
Agree with the analysis here on the 422.

Sebastian Iancu
October 1, 2019, 7:50 AM

@SEC 2019 discussions:
code 422 should be used for semantic validation errors:

  • for missing (unknown) template_id

  • composition content is not valid according to underlying template

Reporter

Sebastian Iancu

Raised By

Sebastian Iancu

Components

Affects versions

Configure