Skip to content

Commit 8b0b9f5

Browse files
committed
explain workaround and enum order
1 parent c07fcad commit 8b0b9f5

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/ARCtrl/Conversion/Workflow.fs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ type WorkflowConversion =
2929
// Check if it's a simple string (shorthand like "File[]", "string?")
3030
match yamlElement with
3131
| YAMLicious.YAMLiciousTypes.YAMLElement.Value _ ->
32-
// Shorthand format
32+
// Shorthand format: parse string directly without YAML context
33+
// Note: YAMLicious.Decode.object requires a YAMLElement for its API,
34+
// but cwlTypeStringMatcher only uses the 'get' function and ignores the element.
35+
// This placeholder satisfies the function without affecting the actual parsing.
36+
let placeholderElement = YAMLicious.YAMLiciousTypes.YAMLElement.Comment "unused-shorthand-context"
3337
YAMLicious.Decode.object (fun get ->
3438
CWL.Decode.cwlTypeStringMatcher t get
35-
) (YAMLicious.YAMLiciousTypes.YAMLElement.Comment "placeholder")
39+
) placeholderElement
3640
|> fst
3741
| YAMLicious.YAMLiciousTypes.YAMLElement.Object [YAMLicious.YAMLiciousTypes.YAMLElement.Sequence items] ->
3842
// YAML array wrapped in Object (happens when parsing multi-line YAML arrays)

src/CWL/CWLTypes.fs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type DirentInstance = {
3333
Writable: bool option
3434
}
3535

36+
/// Represents an enumeration type with a defined set of valid symbol values.
37+
/// Per the CWL specification, symbol order is semantically significant and preserved during serialization.
3638
[<CustomEquality; NoComparison>]
3739
type InputEnumSchema = {
3840
Symbols: ResizeArray<string>
@@ -41,6 +43,9 @@ type InputEnumSchema = {
4143
Name: string option
4244
}
4345
with
46+
/// Equality comparison that treats symbol order as significant.
47+
/// Two enums are equal only if their symbols appear in the same order.
48+
/// This follows the CWL specification where enum symbol order matters.
4449
override this.Equals(o: obj): bool =
4550
match o with
4651
| :? InputEnumSchema as other ->

0 commit comments

Comments
 (0)