From e2ea8fa4a7c2e5b83dc474a8a57bdfa163105229 Mon Sep 17 00:00:00 2001 From: Jakub Duchateau Date: Tue, 27 Jan 2026 11:33:18 +0100 Subject: [PATCH 1/3] Ensure the parser consumed the full JsonPath --- jsonpath4k/src/commonMain/antlr/JsonPathParser.g4 | 2 +- .../kotlin/at/asitplus/jsonpath/JsonPathUnitTest.kt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/jsonpath4k/src/commonMain/antlr/JsonPathParser.g4 b/jsonpath4k/src/commonMain/antlr/JsonPathParser.g4 index a4b6a33..837f88e 100644 --- a/jsonpath4k/src/commonMain/antlr/JsonPathParser.g4 +++ b/jsonpath4k/src/commonMain/antlr/JsonPathParser.g4 @@ -5,7 +5,7 @@ parser grammar JsonPathParser; options { tokenVocab=JsonPathLexer; } -jsonpath_query : rootIdentifier segments; +jsonpath_query : rootIdentifier segments EOF; segments : (ws segment)*; segment : bracketed_selection | SHORTHAND_SELECTOR shorthand_segment | DESCENDANT_SELECTOR descendant_segment; shorthand_segment : wildcardSelector | memberNameShorthand; diff --git a/jsonpath4k/src/commonTest/kotlin/at/asitplus/jsonpath/JsonPathUnitTest.kt b/jsonpath4k/src/commonTest/kotlin/at/asitplus/jsonpath/JsonPathUnitTest.kt index 4140f51..198712c 100644 --- a/jsonpath4k/src/commonTest/kotlin/at/asitplus/jsonpath/JsonPathUnitTest.kt +++ b/jsonpath4k/src/commonTest/kotlin/at/asitplus/jsonpath/JsonPathUnitTest.kt @@ -2,6 +2,7 @@ package at.asitplus.jsonpath import at.asitplus.jsonpath.core.JsonPathFilterExpressionType import at.asitplus.jsonpath.core.JsonPathFunctionExtension +import at.asitplus.jsonpath.implementation.JsonPathParserException import at.asitplus.jsonpath.implementation.JsonPathTypeCheckerException import io.kotest.assertions.throwables.shouldNotThrowAny import io.kotest.assertions.throwables.shouldThrow @@ -1244,5 +1245,13 @@ class JsonPathUnitTest : FreeSpec({ } } } + + "RMLTC0002g-JSON" - { + "$.students[*]]" { + shouldThrow { + JsonPath(this.testScope.testCase.name.originalName) + } + } + } } }) From 0a83dd92e732aa0bcd3d87f593674bf12c13a58a Mon Sep 17 00:00:00 2001 From: acrusage <139230478+acrusage-iaik@users.noreply.github.com> Date: Wed, 28 Jan 2026 15:23:51 +0100 Subject: [PATCH 2/3] Add: Changelog entry to come --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27d85db..e17c5c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# Release 3.0.1 + * Fix: Validates whether the whole string has been consumed + # Release 3.0.0 * BREAKING CHANGES: * Removed template type from `JsonPathFunctionExtension` From b701f461c9819550354712892a96c3ecc27711c5 Mon Sep 17 00:00:00 2001 From: acrusage <139230478+acrusage-iaik@users.noreply.github.com> Date: Wed, 28 Jan 2026 15:28:14 +0100 Subject: [PATCH 3/3] Bump: Version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index e063653..063bb39 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,7 +16,7 @@ kotlin.native.ignoreDisabledTargets=true # workaround dokka bug (need to wait for next snapshot build) org.jetbrains.dokka.classpath.excludePlatformDependencyFiles=true -artifactVersion = 3.0.0 +artifactVersion = 3.0.1 jdk.version=17 android.experimental.lint.version=8.5.0