From 81e9642cb15a4cfcafafa2b3c802da1becefe079 Mon Sep 17 00:00:00 2001 From: Sasindu Alahakoon Date: Wed, 3 Apr 2024 10:23:59 +0530 Subject: [PATCH] Update doc comments and Ballerina tomls --- ballerina/read.bal | 4 ++-- ballerina/tests/jsonpath_complex_tests.bal | 10 ++++++++++ build-config/resources/Ballerina.toml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ballerina/read.bal b/ballerina/read.bal index dd96d99..36eda9b 100644 --- a/ballerina/read.bal +++ b/ballerina/read.bal @@ -25,7 +25,7 @@ public type JsonPathRawTemplate object { public JsonPathValue[] insertions; }; -# Extract details from the given JSON value using the provided query template expression +# Extract details from the given JSON value using the provided query template expression. # # ```ballerina # read({id: 1, "name": "John Doe"}, `$.name`) => "John Doe" @@ -47,7 +47,7 @@ class JsonPathRawTemplateImpl { } } -# Extract details from the given JSON value using the provided query expression +# Extract details from the given JSON value using the provided query expression. # + 'json - JSON value # + query - JSON path expression # + return - extracted details as JSON value, a jsonpath:Error otherwise diff --git a/ballerina/tests/jsonpath_complex_tests.bal b/ballerina/tests/jsonpath_complex_tests.bal index 0af314a..fd89459 100644 --- a/ballerina/tests/jsonpath_complex_tests.bal +++ b/ballerina/tests/jsonpath_complex_tests.bal @@ -813,3 +813,13 @@ function testGeneralJsonPathExpresions() returns error? { result = check read(j5, `@`); test:assertEquals(result, j5); } + +type A JsonPathRawTemplate; + +@test:Config {} +function testTypeReferencetype() returns error? { + A path = `$`; + + json result = check read(j5, path); + test:assertEquals(result, j5); +} diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index f790f13..758ac58 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "data.jsondata" -version = "0.1.0" +version = "@toml.version@" authors = ["Ballerina"] keywords = ["json", "json path", "json-transform", "json transform", "json to json", "json-convert", "json convert"] repository = "https://github.com/ballerina-platform/module-ballerina-data.jsondata"