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

Invalid error message for readonly types with parseString API in jsondata module #7254

Open
SasinduDilshara opened this issue Oct 11, 2024 · 1 comment · May be fixed by ballerina-platform/module-ballerina-data.jsondata#45

Comments

@SasinduDilshara
Copy link

import ballerina/data.jsondata;
import ballerina/io;

type User readonly & record {|
    int id;
|};

public isolated function main() returns error? {
    string user2 = string `{"id": 4012}`;
    User r2 = check jsondata:parseString(user2);
    io:println(r2.id);
}

This gives error: unsupported type '(readonly & record {| int id; |})'.
This should be a valid usecase.

@SasinduDilshara
Copy link
Author

Duplicate issue : #7253

It is different one.
This issue is focused on the parseString API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants