From 0080dd31025f402e6b68e2a5ae5373941ad42a22 Mon Sep 17 00:00:00 2001 From: "Michael R. Crusoe" Date: Fri, 31 Oct 2025 17:27:24 +0100 Subject: [PATCH] "id" is a required field in for Parameters and WorkflowSteps --- .../cwlsdk/cwl1_2/CommandInputParameter.java | 6 ++--- .../cwl1_2/CommandInputParameterImpl.java | 25 ++++++++----------- .../cwlsdk/cwl1_2/CommandOutputParameter.java | 6 ++--- .../cwl1_2/CommandOutputParameterImpl.java | 25 ++++++++----------- .../cwl1_2/ExpressionToolOutputParameter.java | 6 ++--- .../ExpressionToolOutputParameterImpl.java | 25 ++++++++----------- .../cwl1_2/OperationInputParameter.java | 6 ++--- .../cwl1_2/OperationInputParameterImpl.java | 25 ++++++++----------- .../cwl1_2/OperationOutputParameter.java | 6 ++--- .../cwl1_2/OperationOutputParameterImpl.java | 25 ++++++++----------- .../cwlsdk/cwl1_2/WorkflowInputParameter.java | 6 ++--- .../cwl1_2/WorkflowInputParameterImpl.java | 25 ++++++++----------- .../cwl1_2/WorkflowOutputParameter.java | 6 ++--- .../cwl1_2/WorkflowOutputParameterImpl.java | 25 ++++++++----------- .../commonwl/cwlsdk/cwl1_2/WorkflowStep.java | 6 ++--- .../cwlsdk/cwl1_2/WorkflowStepImpl.java | 25 ++++++++----------- .../cwlsdk/cwl1_2/WorkflowStepInput.java | 6 ++--- .../cwlsdk/cwl1_2/WorkflowStepInputImpl.java | 25 ++++++++----------- .../cwlsdk/cwl1_2/WorkflowStepOutput.java | 6 ++--- .../cwlsdk/cwl1_2/WorkflowStepOutputImpl.java | 25 ++++++++----------- .../cwl1_2/utils/PackedWorkflowClassTest.java | 2 +- .../cwl1_2/utils/SecondaryFilesTest.java | 4 +-- 22 files changed, 133 insertions(+), 183 deletions(-) diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java index 81bf8926..1eed93a4 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameter.java @@ -27,12 +27,12 @@ public interface CommandInputParameter extends InputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java index fd7d5091..3ad9056f 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandInputParameterImpl.java @@ -35,15 +35,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -275,13 +275,13 @@ public CommandInputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -293,19 +293,14 @@ public CommandInputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -477,7 +472,7 @@ public CommandInputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.loadContents = (java.util.Optional) loadContents; this.loadListing = (java.util.Optional) loadListing; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java index 4fa8649c..91b032d7 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameter.java @@ -27,12 +27,12 @@ public interface CommandOutputParameter extends OutputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java index 31ddcf41..e9488ba0 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/CommandOutputParameterImpl.java @@ -35,15 +35,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -213,13 +213,13 @@ public CommandOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -231,19 +231,14 @@ public CommandOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -364,7 +359,7 @@ public CommandOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.type = (Object) type; this.outputBinding = (java.util.Optional) outputBinding; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java index 306985d9..929b685a 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameter.java @@ -26,12 +26,12 @@ public interface ExpressionToolOutputParameter extends OutputParameter, Saveable LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java index 1e3b20cb..a810cf74 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/ExpressionToolOutputParameterImpl.java @@ -34,15 +34,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -202,13 +202,13 @@ public ExpressionToolOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -220,19 +220,14 @@ public ExpressionToolOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -336,7 +331,7 @@ public ExpressionToolOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.type = (Object) type; for (String field:__doc.keySet()) { diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java index 0acb947a..43dbe7b3 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameter.java @@ -28,12 +28,12 @@ public interface OperationInputParameter extends InputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java index 88a6c97e..142ae177 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationInputParameterImpl.java @@ -36,15 +36,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -262,13 +262,13 @@ public OperationInputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -280,19 +280,14 @@ public OperationInputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -447,7 +442,7 @@ public OperationInputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.loadContents = (java.util.Optional) loadContents; this.loadListing = (java.util.Optional) loadListing; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java index aec2a6e5..e32555d1 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameter.java @@ -28,12 +28,12 @@ public interface OperationOutputParameter extends OutputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java index 2cb07a23..a51d0b9a 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/OperationOutputParameterImpl.java @@ -36,15 +36,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -202,13 +202,13 @@ public OperationOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -220,19 +220,14 @@ public OperationOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -336,7 +331,7 @@ public OperationOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.type = (Object) type; for (String field:__doc.keySet()) { diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java index ac48d9e1..129ecea7 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameter.java @@ -26,12 +26,12 @@ public interface WorkflowInputParameter extends InputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java index 4adaf13e..65c23b63 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java @@ -34,15 +34,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -274,13 +274,13 @@ public WorkflowInputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -292,19 +292,14 @@ public WorkflowInputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -476,7 +471,7 @@ public WorkflowInputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.loadContents = (java.util.Optional) loadContents; this.loadListing = (java.util.Optional) loadListing; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java index ab45069c..2ce83e8c 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameter.java @@ -34,12 +34,12 @@ public interface WorkflowOutputParameter extends OutputParameter, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java index 1b045a40..208bd693 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowOutputParameterImpl.java @@ -42,15 +42,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#Parameter/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this Parameter. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -252,13 +252,13 @@ public WorkflowOutputParameterImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -270,19 +270,14 @@ public WorkflowOutputParameterImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -437,7 +432,7 @@ public WorkflowOutputParameterImpl( this.secondaryFiles = (Object) secondaryFiles; this.streamable = (java.util.Optional) streamable; this.doc = (Object) doc; - this.id = (java.util.Optional) id; + this.id = (String) id; this.format = (Object) format; this.outputSource = (Object) outputSource; this.linkMerge = (java.util.Optional) linkMerge; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java index 16cf0891..ecab0bd1 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStep.java @@ -106,12 +106,12 @@ public interface WorkflowStep extends Identified, Labeled, Documented, Saveable LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStep/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this WorkflowStep. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#Labeled/label
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java index 67d97be7..4db723b3 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepImpl.java @@ -114,15 +114,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStep/id
*
- * The unique identifier for this object. *
+ * The unique identifier for this WorkflowStep. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -298,13 +298,13 @@ public WorkflowStepImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -316,19 +316,14 @@ public WorkflowStepImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; java.util.Optional label; if (__doc.containsKey("label")) { @@ -484,7 +479,7 @@ public WorkflowStepImpl( if (!__errors.isEmpty()) { throw new ValidationException("Trying 'RecordField'", __errors); } - this.id = (java.util.Optional) id; + this.id = (String) id; this.label = (java.util.Optional) label; this.doc = (Object) doc; this.in = (java.util.List) in; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java index 57403473..581403cb 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInput.java @@ -135,12 +135,12 @@ public interface WorkflowStepInput extends Identified, Sink, LoadContents, Label LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepInput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the source input field name. * */ - java.util.Optional getId(); + String getId(); /** * Getter for property https://w3id.org/cwl/cwl#source
*
diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java index 58745d72..171a2fd5 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepInputImpl.java @@ -143,15 +143,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepInput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the source input field name. *
*/ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -329,13 +329,13 @@ public WorkflowStepInputImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -347,19 +347,14 @@ public WorkflowStepInputImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; Object source; if (__doc.containsKey("source")) { @@ -499,7 +494,7 @@ public WorkflowStepInputImpl( if (!__errors.isEmpty()) { throw new ValidationException("Trying 'RecordField'", __errors); } - this.id = (java.util.Optional) id; + this.id = (String) id; this.source = (Object) source; this.linkMerge = (java.util.Optional) linkMerge; this.pickValue = (java.util.Optional) pickValue; diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java index 4920b23e..d6db2cbc 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutput.java @@ -35,10 +35,10 @@ public interface WorkflowStepOutput extends Identified, Saveable { LoadingOptions getLoadingOptions(); /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepOutput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the workflow parameter to export. * */ - java.util.Optional getId(); + String getId(); } diff --git a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java index b81cf4b9..76ba950b 100644 --- a/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java +++ b/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowStepOutputImpl.java @@ -43,15 +43,15 @@ public java.util.Map getExtensionFields() { return this.extensionFields_; } - private java.util.Optional id; + private String id; /** - * Getter for property https://w3id.org/cwl/cwl#Identified/id
+ * Getter for property https://w3id.org/cwl/cwl#WorkflowStepOutput/id
*
- * The unique identifier for this object. *
+ * The unique identifier of the workflow parameter to export. * */ - public java.util.Optional getId() { + public String getId() { return this.id; } @@ -85,13 +85,13 @@ public WorkflowStepOutputImpl( if (__loadingOptions != null) { this.loadingOptions_ = __loadingOptions; } - java.util.Optional id; + String id; if (__doc.containsKey("id")) { try { id = LoaderInstances - .uri_optional_StringInstance_True_False_None_None + .uri_StringInstance_True_False_None_None .loadField(__doc.get("id"), __baseUri, __loadingOptions); } catch (ValidationException e) { id = null; // won't be used but prevents compiler from complaining. @@ -103,23 +103,18 @@ public WorkflowStepOutputImpl( id = null; } - Boolean __original_is_null = id == null; if (id == null) { if (__docRoot != null) { - id = java.util.Optional.of(__docRoot); + id = __docRoot; } else { - id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString()); + throw new ValidationException("Missing id"); } } - if (__original_is_null) { - __baseUri = __baseUri_; - } else { - __baseUri = (String) id.orElse(null); - } + __baseUri = (String) id; if (!__errors.isEmpty()) { throw new ValidationException("Trying 'RecordField'", __errors); } - this.id = (java.util.Optional) id; + this.id = (String) id; for (String field:__doc.keySet()) { if (!attrs.contains(field)) { if (field.contains(":")) { diff --git a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java index eef899cb..1fff5929 100644 --- a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java +++ b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/PackedWorkflowClassTest.java @@ -35,7 +35,7 @@ public void workflowStepInputSources() { WorkflowStep step1 = (WorkflowStep) workflow.getSteps().get(0); List inputs = step1.getIn(); WorkflowStepInput step1_input1 = (WorkflowStepInput) inputs.get(0); - Assert.assertEquals(workflow_id + "/step1/echo_in1", step1_input1.getId().get()); + Assert.assertEquals(workflow_id + "/step1/echo_in1", step1_input1.getId()); Assert.assertEquals(workflow_id + "/inp1", step1_input1.getSource()); } } diff --git a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java index 71a53283..911112f7 100644 --- a/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java +++ b/src/test/java/org/commonwl/cwlsdk/cwl1_2/utils/SecondaryFilesTest.java @@ -28,7 +28,7 @@ public void workflowInputSecFiles() { String workflow_id = workflow.getId().get(); List inputs = workflow.getInputs(); WorkflowInputParameter wf_file_input = (WorkflowInputParameter) inputs.get(1); - Assert.assertEquals(workflow_id + "/wf_file_input", wf_file_input.getId().get()); + Assert.assertEquals(workflow_id + "/wf_file_input", wf_file_input.getId()); List sec_files_l1 = (List) wf_file_input.getSecondaryFiles(); Assert.assertEquals(1, sec_files_l1.size()); @@ -36,7 +36,7 @@ public void workflowInputSecFiles() { Assert.assertEquals(".also", sec_files1.getPattern()); Assert.assertEquals(true, sec_files1.getRequired()); WorkflowInputParameter wf_file_input_array = (WorkflowInputParameter) inputs.get(2); - Assert.assertEquals(workflow_id + "/wf_file_input_array", wf_file_input_array.getId().get()); + Assert.assertEquals(workflow_id + "/wf_file_input_array", wf_file_input_array.getId()); List sec_files_l2 = (List) wf_file_input_array.getSecondaryFiles(); Assert.assertEquals(1, sec_files_l2.size());