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 result for empty xml tags with required fields in data.xmldata module #7416

Open
SasinduDilshara opened this issue Nov 27, 2024 · 0 comments
Assignees
Labels

Comments

@SasinduDilshara
Copy link
Contributor

Description

No response

Steps to Reproduce

import ballerina/data.xmldata;
import ballerina/io;

type Root record {
    string Book;
};

public function main() {
    Root|error a = xmldata:parseAsType(xml `<root><Book></Book></root>`);
    io:println(a);
}

The above code sample gives {"Book":null} as the rsult, while the expected result should be an error since the Book field in the record is a required field.

Version

2201.10.2

Environment Details (with versions)

No response

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

No branches or pull requests

1 participant