Skip to content

Commit

Permalink
feat(pipelinetemplate): Adding group & example to template variables (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
robzienert committed Apr 5, 2017
1 parent 75c54d2 commit f58722a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ public void setOwner(String owner) {

public static class Variable implements NamedContent {
private String name;
private String group = "Ungrouped";
private String description;
private String type;
private Object defaultValue;
private String example;

@Override
public String getName() {
Expand All @@ -81,6 +83,14 @@ public void setName(String name) {
this.name = name;
}

public String getGroup() {
return group;
}

public void setGroup(String group) {
this.group = group;
}

public String getDescription() {
return description;
}
Expand Down Expand Up @@ -108,6 +118,14 @@ public void setDefaultValue(Object defaultValue) {
public boolean hasDefaultValue() {
return defaultValue != null;
}

public String getExample() {
return example;
}

public void setExample(String example) {
this.example = example;
}
}

public static class Configuration {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ public String render(String template, RenderContext context) {

@Override
public Object renderGraph(String template, RenderContext context) {
return renderedValueConverter.convertRenderedValue(render(template, context));
// TODO rz - Need to catch exceptions out of this value converter & give more detailed information if it's a nested
// value. For example, if iterating over module output, the line number reported by yamlsnake will be for the final
// template, not the input, so it's difficult to correlate what actually is broken.
String renderedValue = render(template, context);
return renderedValueConverter.convertRenderedValue(renderedValue);
}

private static class NoopResourceLocator implements ResourceLocator {
Expand Down

0 comments on commit f58722a

Please sign in to comment.