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

ParserAsType gives error when we disable the data projection for map types #7329

Closed
lnash94 opened this issue Nov 4, 2024 · 1 comment · Fixed by ballerina-platform/module-ballerina-data.jsondata#49

Comments

@lnash94
Copy link
Member

lnash94 commented Nov 4, 2024

Description

No response

Steps to Reproduce

The issue can be reproduced by executing(bal run) the below ballerina code,
note: this error occurs for every data type with map, ex: map<int>, map<string>, map<byte[]>, etc.

[1] Ballerina code

import ballerina/data.jsondata;
public function main() returns error? {
    json a = {id: "chamil", values: {a: 2, b: 45, c: {x: "mnb", y: "uio"}}};
    map<json> _ = check jsondata:parseAsType(a, options = {allowDataProjection: false});
}

[2] Error

error: undefined field 'id'

Version

0.3.0-20241028-143400-903c253

Environment Details (with versions)

No response

Copy link

This issue is NOT closed with a proper Reason/ label. Make sure to add proper reason label before closing. Please add or leave a comment with the proper reason label now.

      - Reason/EngineeringMistake - The issue occurred due to a mistake made in the past.
      - Reason/Regression - The issue has introduced a regression.
      - Reason/MultipleComponentInteraction - Issue occured due to interactions in multiple components.
      - Reason/Complex - Issue occurred due to complex scenario.
      - Reason/Invalid - Issue is invalid.
      - Reason/Other - None of the above cases.

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