Fix bug in JsonEncoder - cannot handle records and fields with the same name
The JsonEncoder pipeline component cannot cope with schemas that have records and field elements with the same name. Doing this:
Where the outer foo is a record type and the inner foo is a field element, causes the inscrutable error message:
Reason: Value cannot be null.
Parameter name: key
emitted to the event log.
This is corroborated by at least one other user:
This is a perfectly valid scenario in both XML and JSON and there is no good reason not to support it. Even if there is some obscure technical reason why not, at the very least the error message should tell you what is wrong, and the JSON schema wizard should either change the names so that it is accepted, or refuse to accept an input instance document that would generate an unacceptable schema.
Coen aka Colin Dijkgraaf commented
Also if you have an two elements of the same name anywhere in the JSON structure, it will use the type of the first one it encounters for all the elements with that name, even if they are different types. See https://www.codit.eu/blog/2017/04/26/json-encoder-type-bug/