Skip to content

MudJsonTreeView: Unable to render Json Structure that includes a numeric double value #450

@mwiehler

Description

@mwiehler

MudJsonTreeView is unable to render the following JsonStructure:

{
    "invoices": [
        {
            "invoice_number": "14332",
            "invoice_date": "29.06.2021",
            "due_date": "12.07.2021",
            "total_amount": 2454.9,
            "bill_to_name": "Fa. X GmbH",
            "bill_to_address": "Hohenstr. 32, D-30159 Hannover",
            "bill_to_phone_no": "",
            "vendor_name": "Experten GmbH 1)",
            "vendor_address": "Industrieallee 5, D-30175 Hannover",
            "vendor_phone_no": "0511/918273",
            "taxpayer_id_number": "DE 99999999",
            "USt.-IdNr.": "DE 99999999",
            "IBAN": "DE40250501800038929101",
            "items": [
                {
                    "position": "1",
                    "item": "Bohrmaschine \"Superdreh 500\"",
                    "quantity": "10",
                    "unit": "",
                    "price": "200",
                    "total_amount": "2000"
                },
                {
                    "position": "2",
                    "item": "Briketts \"Immerzünd\" (5 kg)",
                    "quantity": "10",
                    "unit": "",
                    "price": 7,
                    "total_amount": "70"
                }
            ]
        }
    ]
}

The issue seems to be, that the component is unable to parse the "total_amount": 2454.9 field. It throws an exception because it tries to deserialize it as int instead of double.

This can be reproduced for example here https://codebeam-mudextensions.pages.dev/mudjsontreeview and will produce an unhandled exception!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions