ditrit/OGrEE-CLI

Wrong JSON format when creating rooms from templates

Closed this issue · 0 comments

In a room JSON, all values in the attributes array should be string. When creating a room with a template containing

    "technicalArea": [],
    "reservedArea": [],

, the room JSON contains

{
...
    "attributes": {
        ...
        "reserved": [],   <- Wrong
        "separators": "[]", <- Correct
        "size": "{\"x\":0, \"y\":0}",
        "sizeUnit": "m",
        "technical": [], <- Wrong
        "template": "bnpp-md-1ss-srv",
        ...
    }
    ...
}

The bug doesn't occur when reservedArea and technicalArea are not empty like

    "technicalArea": [0,0,0,0],
    "reservedArea": [0,0,0,0],

, then the room JSON contains

"reserved": "{\"left\":0,\"right\":0,\"top\":0,\"bottom\":0}",
"technical": "{\"left\":0,\"right\":0,\"top\":0,\"bottom\":0}",

and the result in Unity is the same (but it shouldn't be required to write a null Vector4 for it to work).