wso2 / ballerina-vscode

To keep Ballerina VSCode plugin related issues, discussions, etc.
Apache License 2.0
41 stars 20 forks source link

[Data Mapper] Unable to map fields within optional fields #521

Closed madushajg closed 11 months ago

madushajg commented 11 months ago

Description: $title

https://github.com/wso2/ballerina-plugin-vscode/assets/26219651/045ad796-9c1c-407b-9a28-e8bb9017d38b

Steps to reproduce: Sample source:

type Ward record {
    string id;
    Doctor[] doctors?;
};

type Doctor record {
    string id;
};

type Hospital record {
    string description;
    Doctor[] doctors;
};

function transform(Ward ward) returns Hospital => {
    doctors: from var doctorsItem in ward.doctors ?: []
        select {
            id: doctorsItem.id
        }
};

Affected Versions: Plugin v4.4.1 Ballerina 2201.7.0