Closed nichtich closed 4 years ago
toScheme
will already fall back to schemes[0]
. I can remove the check completely, but if someone did something like you described, the resulting mappings would basically be invalid (no fromScheme
).
I will also take a closer look at the code, I'm not sure whether it needs to be as complicated as it is.
At https://github.com/gbv/cocoda-sdk/blob/6f48fce4b4c174b4f6355d55ae50c97c21e8f2cc/providers/reconciliation-api-provider.js#L55 we could remove testing from
fromScheme
. Settingfrom.inScheme
to[ {} ]
works anyway, so there is no reason to havefromSchem
except for copying it into the result mappings.We could further make
to.inScheme
optional and set it toschemes[0]
if the registry has exactely one scheme, so this should work: