Skip to content

Commit

Permalink
fix direct map decode
Browse files Browse the repository at this point in the history
  • Loading branch information
caroott authored and kMutagene committed Oct 21, 2024
1 parent ccefbff commit 01a3c04
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/CWL/Decode.fs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,16 @@ module Decode =
[|
for key in dict.Keys do
let value = dict.[key]
let source = stringOptionFieldDecoder "source" value
let source =
let s1 =
match value with
| YAMLElement.Object [YAMLElement.Value v] -> Some v.Value
| _ -> None
let s2 = stringOptionFieldDecoder "source" value
match s1,s2 with
| Some s1, _ -> Some s1
| _, Some s2 -> Some s2
| _ -> None
let defaultValue = stringOptionFieldDecoder "default" value
let valueFrom = stringOptionFieldDecoder "valueFrom" value
{ Id = key; Source = source; DefaultValue = defaultValue; ValueFrom = valueFrom }
Expand Down

0 comments on commit 01a3c04

Please sign in to comment.