wdl icon indicating copy to clipboard operation
wdl copied to clipboard

Clarify whether extra keys are allowed when coercing `Map` to `Struct`

Open jlumpe opened this issue 2 years ago • 3 comments

I have noticed that when coercing JSON data to a struct (as in MyStruct x = read_json("data.json")) miniwdl will give me an error if the JSON object contains contains properties/keys not in the struct, while Cromwell doesn't. I haven't found anything in the spec which explicitly states whether this should be allowed. In my opinion it makes a lot of sense to be permissive in this regard.

Draft implementation: https://github.com/openwdl/wdl/tree/482-extra-keys

jlumpe avatar Nov 14 '21 23:11 jlumpe

I agree that permissive makes a lot of sense and it should indeed be made explicit. Workflow engines should be able to configure a change to this setting.

rhpvorderman avatar Nov 15 '21 07:11 rhpvorderman

+1

I added this to the roadmap

jdidion avatar Nov 15 '21 13:11 jdidion

+1 as well. This feels overly strict at the moment to not allow extra keys in an JSON document. Its a bit onerous to have to create a 1:1 representation with any JSON document in order to use it in a wdl

patmagee avatar Nov 23 '21 13:11 patmagee