Howto reconstruct minimal JSON to full JSON

Hi,

I serialize a textual model into minimal JSON using syside.SerializationOptions.minimal()
Then I want to read in that JSON and save it as “complete” JSON with

options = syside.SerializationOptions().minimal().with_options( 

use_standard_names=True,     include_derived=True,        include_redefined=True,

        include_default=False,        include_optional=False,        include_implied=True,

    )

The JSON document can contain multiple root namespaces, and the JSON can be randomly ordered.
I made various attempts but can’t get it to work.

Thanks for your help!

Robert

Hi,

Minimal JSONs do not contain implicit relationships hence you will need to resolve sema again, e.g.

syside.Sema().resolve(
    [doc0, doc1, ...],
    index=syside.Environment.get_default().index(),
    stdlib=syside.Environment.get_default().lib,
)

Ordering should not matter much here though some issues may crop up since the primary use case is still source text parsing with reference resolution.

Multiple roots in the same document are not supported.