Show a patch.

GET /api/patches/21293/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 21293,
    "url": "https://patchwork.libcamera.org/api/patches/21293/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21293/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240920132823.88433-3-stefan.klug@ideasonboard.com>",
    "date": "2024-09-20T13:28:09",
    "name": "[v3,2/3] libcanera: yaml-parser: Add failing test for unexpected behavior",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e762bc6418f5b17badb34cfc9f5fd4ffebe63ccb",
    "submitter": {
        "id": 184,
        "url": "https://patchwork.libcamera.org/api/people/184/?format=api",
        "name": "Stefan Klug",
        "email": "stefan.klug@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21293/mbox/",
    "series": [
        {
            "id": 4608,
            "url": "https://patchwork.libcamera.org/api/series/4608/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4608",
            "date": "2024-09-20T13:28:07",
            "name": "libcamera: yaml-parser: Differentiate between empty and empty string",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/4608/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21293/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21293/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8E5E1C32D5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Sep 2024 13:28:48 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 19E2063502;\n\tFri, 20 Sep 2024 15:28:48 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0CEF4634F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Sep 2024 15:28:45 +0200 (CEST)",
            "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:8ade:938d:48b1:cede])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2CCD2564;\n\tFri, 20 Sep 2024 15:27:21 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"t+7dpps9\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726838841;\n\tbh=m2RgS724KWx8eCi9Q/T7eoD8iBBuW1+7oBXMi0+RQfU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=t+7dpps9WFLFPezIP6JBf+hrMbXSIsn7YwHB2ay19sc/WFGvK9MQ72/PbK0qsb/7v\n\txt5zNY52S6W552B4o1cqpTxIrICRlQF7aOa068v8S96T3g1s/46jpxV1D1UXLCSyWc\n\tXcuVXi0G4oXxiOYwiqE786bM4zagUjz4pelhVRaA=",
        "From": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>",
        "Subject": "[PATCH v3 2/3] libcanera: yaml-parser: Add failing test for\n\tunexpected behavior",
        "Date": "Fri, 20 Sep 2024 15:28:09 +0200",
        "Message-ID": "<20240920132823.88433-3-stefan.klug@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240920132823.88433-1-stefan.klug@ideasonboard.com>",
        "References": "<20240920132823.88433-1-stefan.klug@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "When accessing a nonexistent key on a dict the YamlObject returns an\nempty element. This element can happily be cast to a string. This is\nunexpected. For example the following statement:\n\nyamlDict[\"nonexistent\"].get<string>(\"default\")\n\nis expected to return \"default\" but actually returns \"\". Add a (failing)\ntestcase for that behavior.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\n---\nChanges in v3:\n- Added separate patch for the failing test\n---\n test/yaml-parser.cpp | 6 ++++++\n 1 file changed, 6 insertions(+)",
    "diff": "diff --git a/test/yaml-parser.cpp b/test/yaml-parser.cpp\nindex 347999831d61..4cc77e26ae39 100644\n--- a/test/yaml-parser.cpp\n+++ b/test/yaml-parser.cpp\n@@ -536,6 +536,12 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\t/* Test access to nonexistent member. */\n+\t\tif (dictObj[\"nonexistent\"].get<std::string>(\"default\") != \"default\") {\n+\t\t\tcerr << \"Accessing nonexistent dict entry fails to return default\" << std::endl;\n+\t\t\treturn TestFail;\n+\t\t}\n+\n \t\t/* Make sure utils::map_keys() works on the adapter. */\n \t\t(void)utils::map_keys(dictObj.asDict());\n \n",
    "prefixes": [
        "v3",
        "2/3"
    ]
}