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

The Name annotation is disregarded when toJson is used with tables #7348

Closed
MaryamZi opened this issue Nov 11, 2024 · 1 comment · Fixed by ballerina-platform/module-ballerina-data.jsondata#52
Assignees
Labels
module/data.jsondata Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Type/Bug

Comments

@MaryamZi
Copy link
Member

Description

$title. ballerina-platform/module-ballerina-data.jsondata#35 has addressed lists and mappings, but not tables.

Steps to Reproduce

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

type Foo record {|
    @jsondata:Name {
        value: "a-b"
    }
    int a;
|};

public function main() {
    table<Foo> foo = table [
        {a: 123}
    ];
    io:println(jsondata:toJson(foo));
}

Version

0.3.0-SNAPSHOT

Environment Details (with versions)

No response

@MaryamZi
Copy link
Member Author

Need to consider #7326 also when fixing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module/data.jsondata Reason/EngineeringMistake The issue occurred due to a mistake made in the past. Type/Bug
Projects
Archived in project
1 participant