Hi @Daumantas and team,
I serialize a textual v2 model into json, and store it in a v2 API compliant repository (OpenMBEE flexo)
When I retrieve the model as json from that repository, due to the nature of those technologies,
the json elements are not anymore in the order as when the model was serialized.
The deserialization seems to require to be in the order how they are defined without forward references, and that’s not the case because we want to be able to commit incremental and partial models to those repositories. It’s not an all or nothing commit or retrieve.
When the json elements are out of order the deserialization fails for certain models.
This is extremely limiting for integration and scalability.
This is the minimal model to reproduce the issue:
part m0001_2N {
part nx0001 {
port scp_outside2;
}
part tcs0001{
port scp;
}
interface tcs0001.scp to nx0001.scp_outside2;
}
Attached (but for some reason I’m not allowed to upload as “new user”) is the json created with syside (raw.json) and the one retrieved from the repository (flexo.json)
They are identical but the order is different. We handle already the root namespace that syside expects to be the first element when deserializing. But that’s not enough.
When I remove the line with the interface, the deserialization works just fine because in the json the elements for the interface happen to reference elements that appear later in the json representation.
I hope this is an easy fix, as it is critical for integrating syside into a standard v2 API environment.
One approach could be to make 2+ passes when parsing. It could be an optional argument.
In another step it could become incremental in general. For larger models, we’ll have to use pagination, and would want to deserialize incrementally, adding pages of json, one by one until the model is complete.
Thank you for your help and support.
Robert
cc @rubayet