From ba7e14919c40830aac6c09a9c690bf656cd2e1cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6rdes?= Date: Thu, 19 Mar 2026 09:58:41 +0100 Subject: [PATCH 01/14] rm schema validation --- .../membrane/annot/yaml/GenericYamlParser.java | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java b/annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java index d06f307871..64e92057d2 100644 --- a/annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java +++ b/annot/src/main/java/com/predic8/membrane/annot/yaml/GenericYamlParser.java @@ -79,9 +79,6 @@ public GenericYamlParser(Grammar grammar, String yaml) throws IOException { continue; } - // Deactivated temporarily to get better error messages - //validateAgainstSchema(grammar, jsonNode, jsonLocationMap); - var pc = new ParsingContext<>("", null, grammar, jsonNode, "$", null); if ("components".equals(getBeanType(pc, jsonNode))) { @@ -97,20 +94,6 @@ public GenericYamlParser(Grammar grammar, String yaml) throws IOException { } } - private static void validateAgainstSchema(Grammar grammar, JsonNode jsonNode, JsonLocationMap jsonLocationMap) throws IOException { - // Validate YAML against JSON schema - try { - validate(grammar, jsonNode); - } catch (YamlSchemaValidationException e) { - JsonLocation location = jsonLocationMap.getLocationMap().get( - e.getErrors().getFirst().getInstanceNode()); - throw new IOException("Invalid YAML: %s at line %d, column %d.".formatted( - e.getErrors().getFirst().getMessage(), - location.getLineNr(), - location.getColumnNr()), e); - } - } - /** * Entry point used by the runtime to consume a YAML stream. *