@Test
    @Issue("2628")
    void unknownProperty(JenkinsConfiguredWithCodeRule j) throws Exception {
        j.jenkins.setCrumbIssuer(null);

        WebResponse response = performYamlValidation(
                j,
                "jenkins:\n  nonExistentProperty: \"This property doesn't exist\"\n  systemMessage: \"Valid property\"");

        assertThat(response.getContentType(), is("application/json"));

        // Verify the response contains valid JSON regardless of status code
        String responseString = response.getContentAsString();
        JSONArray jsonResponse = JSONArray.fromObject(responseString);

        // The response should be a non-empty JSON array with details about the unknown property
        assertThat("Should return error details", jsonResponse.size() > 0, is(true));
        assertThat(responseString, containsString("nonExistentProperty"));
    }
Tests that YAML with unknown property returns proper JSON response.
test-harness/src/test/java/io/jenkins/plugins/casc/YamlValidationTest.java