Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add read functionality with Jsonpath expressions for Ballerina json datatypes #1

Merged
merged 29 commits into from
Apr 3, 2024

Conversation

SasinduDilshara
Copy link
Contributor

Purpose

Add read functionality for Ballerina json data types with jsonpath expressions.

import ballerina/data.jsondata as jsondata;

json store = {
    store: {
        book: [
            {
                category: "reference",
                author: "Nigel Rees",
                title: "Sayings of the Century",
                price: 8.95
            },
          ....................
        ],
        bicycle: {
            color: "red",
            price: 19.95
        }
    },
    expensive: 10
};

function test1() returns json|error {
    return check jsondata:read(store, `$.store.book[*].author`);
}

Fixes ballerina-platform/ballerina-library#5938

Copy link
Contributor

@prakanth97 prakanth97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit 5a659c3 contains the base for the jsondata library and it is building properly. It would be better, if you add your changes on top of this. WDYT? @SasinduDilshara @hasithaa

ballerina/errors.bal Outdated Show resolved Hide resolved
ballerina/init.bal Outdated Show resolved Hide resolved
gradle/wrapper/gradle-wrapper.properties Outdated Show resolved Hide resolved
native/src/main/java/module-info.java Outdated Show resolved Hide resolved
ballerina/jsonpath.bal Outdated Show resolved Hide resolved
settings.gradle Outdated Show resolved Hide resolved
@SasinduDilshara
Copy link
Contributor Author

This commit 5a659c3 contains the base for the jsondata library and it is building properly. It would be better, if you add your changes on top of this. WDYT? @SasinduDilshara @hasithaa

Lets add the commit as a PR, then I will rebase it based on that.
wdyt?

@SasinduDilshara SasinduDilshara marked this pull request as draft January 31, 2024 10:03
@SasinduDilshara
Copy link
Contributor Author

Mark this as a draft since, the PR that contains base files should be send before this

@hasithaa
Copy link
Contributor

@SasinduDilshara Still windows GrallVM validation fails.

@SasinduDilshara
Copy link
Contributor Author

@SasinduDilshara Still windows GrallVM validation fails.

Had a chat with @TharmiganK regarding these failures, This is because this GraalVm checks test with Lang-master branch,

I was able to produce that locally now. Will fix it

ballerina/read.bal Outdated Show resolved Hide resolved
ballerina/read.bal Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLAassistant commented Apr 3, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@prakanth97 prakanth97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hasithaa hasithaa merged commit b0d3dfe into ballerina-platform:main Apr 3, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Add Jsonpath support for Ballerina json module
6 participants