Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,30 @@ class ScriptLoaderV2Test extends Dsl2Spec {
outputs.getFiles().size() == 3
}

def 'should allow optional param' () {

given:
def session = new Session()
def parser = new ScriptLoaderV2(session)

def TEXT = '''
params {
path: Path?
}

workflow {
params.path
}
'''

when:
parser.parse(TEXT)
parser.runScript()

then:
parser.getResult() == null
}

def 'should support enums' () {

given:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public void visitParams(ParamBlockNode node) {
.map((param) -> {
var name = constX(param.getName());
var type = classX(param.getType());
var optional = constX(type.getNodeMetaData(ASTNodeMarker.NULLABLE) != null);
var optional = constX(param.getType().getNodeMetaData(ASTNodeMarker.NULLABLE) != null);
var arguments = param.hasInitialExpression()
? args(name, type, optional, param.getInitialExpression())
: args(name, type, optional);
Expand Down
Loading