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

Error when using parseAsType json in to given record with field as escap characters #6993

Open
lnash94 opened this issue Sep 13, 2024 · 1 comment

Comments

@lnash94
Copy link
Member

lnash94 commented Sep 13, 2024

Description:
Please refer to the below sample

type A record {
    @jsondata:Name {value: "c"}
    int a\-name;
    string b\-name;
};
public function main() {
    A|error z =  jsondata:parseAsType({c: 10, b\-name: "a"});
    io:println(z);
}

When it runs it gives a below error

error Error ("required field 'a-name' not present in JSON")

Expected output

{"a-name":10,"b-name":"a"}

Suggested Labels:

Suggested Assignees:

Affected Product Version:

OS, DB, other environment details and versions:

Steps to reproduce:

Related Issues:

@lnash94 lnash94 changed the title Error issue when using parseAsType json in to given record with field as escap characters Error when using parseAsType json in to given record with field as escap characters Sep 13, 2024
@SasinduDilshara SasinduDilshara transferred this issue from ballerina-platform/module-ballerina-data.jsondata Sep 13, 2024
@SasinduDilshara SasinduDilshara self-assigned this Sep 20, 2024
@SasinduDilshara
Copy link

This issue will be fix with the https://github.com/ballerina-platform/ballerina-lang/pull/41540/files.
It is not merged into master branch yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: On Hold
Development

No branches or pull requests

3 participants