Skip to content

BHoM_Engine: Elegantly handle nested lists within JSONs  #2674

Closed
@tg359

Description

@tg359

Description:

Deserialisation from JSON into BHoM does not handle nested lists elegantly.

Steps to reproduce:

Try loading this JSON and converting it into a CustomObject:

{
    "Data": [
        [1, 2, 3],
        [4, 5, 6],
        [7, 8, 9],
        [10, 11, 12],
        [
            [1, 2, 3],
            [4, 5, 6],
            [7, 8, 9],
            [10, 11, 12]
        ]
    ]
}

image

Expected behaviour:

I'd like to be able to load from JSON containing this type of nested data structure. A recursive cast to List seems to work, but could be done within BHoM far more efficiently.

Test file(s):

Metadata

Metadata

Labels

severity:mediumSlows progress, but workaround is possiblesize:SMeasured in minutestype:bugError or unexpected behaviour

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions