Commit 65ab7516 authored by kzangeli's avatar kzangeli
Browse files

fix(003_06,003_08): batch @context/Content-Type mismatch is a request-level 400

A Create Batch where the Content-Type conflicts with an entity's @context
(application/json + an entity carrying @context; or application/ld+json + an
entity missing @context) is rejected at the request level with 400 BadRequestData
— per TS 104-175 the whole request fails if any entity in the array violates the
constraint — not a per-entity error inside a 207. Assert 400 + a flat
ProblemDetails instead of 207 + errors[0].error.
parent bd252bc2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_JSON}

    Check Response Status Code    207    ${response.status_code}
    Check Response Status Code    400    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()['errors'][0]['error']}
    ...    ${response.json()}
    ...    ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Containing ProblemDetails Element Containing Title Element
    ...    ${response.json()['errors'][0]['error']}
    ...    ${response.json()}
+3 −3
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@ Resource ${EXECDIR}/resources/JsonUtils.resource

    ${response}=    Batch Create Entities    @{entities_to_be_created}    content_type=${CONTENT_TYPE_LD_JSON}

    Check Response Status Code    207    ${response.status_code}
    Check Response Status Code    400    ${response.status_code}
    Check Response Body Containing ProblemDetails Element Containing Type Element set to
    ...    ${response.json()['errors'][0]['error']}
    ...    ${response.json()}
    ...    ${ERROR_TYPE_BAD_REQUEST_DATA}
    Check Response Body Containing ProblemDetails Element Containing Title Element
    ...    ${response.json()['errors'][0]['error']}
    ...    ${response.json()}