Skip to content

500 internal server error when starting a testcase through the REST API with malformed JSON #233

Description

@olw-medcom

Hey there!

It seems that when I attempt to call POST https://test.itb.medcom.dk/api/rest/tests/start with some malformed JSON:

{
    "system": "bla",
    "testCase": [
        "ekg-document-validation-only"
    missing end-bracket here,
    "testSuite": ["EKG-document-creator-suite"],
    "actor": "bla",
    "inputMapping": [
        {
            "input": {
                "name": "isAPITestExecution",
                "value": "true"
            }
        }
    ]
}

Then I get a 500 Internal Server Error response with this body:

{
    "error_code": "Unexpected error",
    "error_description": "Invalid Json: Unexpected character ('m' (code 109)): was expecting comma to separate Array entries\n at [Source: REDACTED (`StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION` disabled); line: 5, column: 5].",
    "error_id": ""
}

This is quite misinforming and I've had a vendor that thought it was an error on the ITB side rather than their own JSON code. I was wondering if atleast the error could become a 400 bad request instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnightlyThis issue has been resolved and is available on the nightly build.

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions