{"record":{"id":"19d3723f0e7500de","repo":"quarkusio/quarkus","slug":"json-object-ended-without","errorCode":null,"errorMessage":"Json object ended without }","messagePattern":"Json object ended without \\}","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"info","filePath":"core/builder/src/main/java/io/quarkus/builder/JsonReader.java","lineNumber":121,"sourceCode":"\n        Map<JsonString, JsonValue> members = new HashMap<>();\n\n        while (position < length) {\n            ignoreWhitespace();\n            switch (peekChar()) {\n                case '}':\n                    position++;\n                    return new JsonObject(members);\n                case ',':\n                    position++;\n                    break;\n                case '\"':\n                    readMember(members);\n                    break;\n            }\n        }\n\n        throw new IllegalArgumentException(\"Json object ended without }\");\n    }\n\n    /**\n     * member\n     * |----- ws string ws ':' element\n     */\n    private void readMember(Map<JsonString, JsonValue> members) {\n        final JsonString attribute = readString();\n        ignoreWhitespace();\n        final int colon = nextChar();\n        if (':' != colon) {\n            throw new IllegalArgumentException(\"Expected : after attribute\");\n        }\n        final JsonValue element = readElement();\n        members.put(attribute, element);\n    }\n\n    /**","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/core/builder/src/main/java/io/quarkus/builder/JsonReader.java#L103-L139","documentation":"GreetingResource.error is a deliberate failing endpoint: a GET to /error always throws RuntimeException(\"Oups!\"). It exists to test error handling in the Google Cloud Functions HTTP adapter, so this message is expected behavior rather than a bug in your code path.","triggerScenarios":"GET on the /error path of the GCP function — unconditionally throws.","commonSituations":"Running the google-cloud-functions-http integration test suite; probing function endpoints and accidentally hitting /error; using it as a canary to verify exception-to-HTTP-500 mapping.","solutions":["Nothing to fix — do not call GET /error unless intentionally testing error handling.","Check the client URL/path if /error was hit accidentally.","If you expected a different endpoint, correct the request path.","In tests, assert on the 500 response rather than treating it as a failure."],"exampleFix":"// before\ncurl http://localhost:8080/error // always 500\n// after\ncurl http://localhost:8080/hello // use a working endpoint","handlingStrategy":"validation","validationCode":"if (type == null || !type.equalsIgnoreCase(\"name\")) {\n    throw new IllegalArgumentException(\"fruitsFindBy only supports type=name\");\n}\ngiven().queryParams(\"type\", \"name\", \"value\", value).get(\"/fruitsFindBy\");","typeGuard":null,"tryCatchPattern":"try {\n    given().queryParams(\"type\", type, \"value\", value).get(\"/fruitsFindBy\");\n} catch (IllegalArgumentException e) {\n    // retry with type=name\n}","preventionTips":["Hard-code type=name for this endpoint unless extended","Document supported query types in the API contract/test base","Validate query parameters before requests in shared test helpers","Add an ExceptionMapper for a 400 instead of a 500 on bad types"],"tags":["rest","gcp","cloud-functions","intentional-error"],"backgroundTag":"intentional-error-endpoint","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}