Expand all relative ids to absolute ids and register them in the schema lookup and also expand all $ref pointers.
The schema lookup
A tuple containing a field name and the schema the field refers to. Nothing is done with the field name, it is there to make folding easier on schema fragments and object properties.
The schema lookup with added object references.
For each unprocessed object, lookup the selection references and collect al selection objects recursively and fill in the parent-child relations.
Check if there is a type field present in each leaf-object that is an EnumEl with one element and fill in the typeDiscriminatorValue field in each of them.