Skip to content

solo 'mapSubject' under jsonldPredicate not rendering in HTML #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mr-c opened this issue Apr 9, 2018 · 4 comments
Closed

solo 'mapSubject' under jsonldPredicate not rendering in HTML #167

mr-c opened this issue Apr 9, 2018 · 4 comments
Labels

Comments

@mr-c
Copy link
Member Author

mr-c commented Apr 9, 2018

Anywhere we have just a mapSubject but not mapPredicate then this rendering bug is triggered: {Workflow,CommandLineTool,Expression}.requirements and Workflow.steps

@mr-c
Copy link
Member Author

mr-c commented Apr 9, 2018

Workflow.steps is fixed by restoring the flow-through of the jsonldPredicate when nbsp is false:

steps: array<WorkflowStep> | map<WorkflowStep.id, WorkflowStep>

diff --git a/schema_salad/makedoc.py b/schema_salad/makedoc.py
index 45bcab2..c2f9b9a 100644
--- a/schema_salad/makedoc.py
+++ b/schema_salad/makedoc.py
@@ -237,7 +237,7 @@ class RenderType(object):
             if nbsp and len(tp) <= 3:
                 return "&nbsp;|&nbsp;".join([self.typefmt(n, redirects, jsonldPredicate=jsonldPredicate) for n in tp])
             else:
-                return " | ".join([self.typefmt(n, redirects) for n in tp])
+                return " | ".join([self.typefmt(n, redirects, jsonldPredicate=jsonldPredicate) for n in tp])
         if isinstance(tp, dict):
             if tp["type"] == "https://w3id.org/cwl/salad#array":
                 ar = "array&lt;%s&gt;" % (self.typefmt(

But for {Workflow,CommandLineTool,Expression}.requirements (and to a lesser extent, {Workflow,CommandLineTool,Expression}.hints) the change is unsatisfactory in part due to the fact that the abstract ProcessRequirement type is never rendered:

requirements: array<InlineJavascriptRequirement | SchemaDefRequirement | DockerRequirement | SoftwareRequirement | InitialWorkDirRequirement | EnvVarRequirement | ShellCommandRequirement | ResourceRequirement | SubworkflowFeatureRequirement | ScatterFeatureRequirement | MultipleInputFeatureRequirement | StepInputExpressionRequirement> | map<InlineJavascriptRequirement | SchemaDefRequirement | DockerRequirement | SoftwareRequirement | InitialWorkDirRequirement | EnvVarRequirement | ShellCommandRequirement | ResourceRequirement | SubworkflowFeatureRequirement | ScatterFeatureRequirement | MultipleInputFeatureRequirement | StepInputExpressionRequirement.class, InlineJavascriptRequirement | SchemaDefRequirement | DockerRequirement | SoftwareRequirement | InitialWorkDirRequirement | EnvVarRequirement | ShellCommandRequirement | ResourceRequirement | SubworkflowFeatureRequirement | ScatterFeatureRequirement | MultipleInputFeatureRequirement | StepInputExpressionRequirement>

hints: array | map<Any.class, Any>

@tetron
Copy link
Member

tetron commented Jul 30, 2018

So the problem is that at this point the rendering doesn't have access to the abstract classes, and doesn't easily have access to the types being cross referenced either. So some solutions are much harder to implement than others.

After some fiddling, here's what I came up with:

array<InlineJavascriptRequirement | SchemaDefRequirement | DockerRequirement | SoftwareRequirement | InitialWorkDirRequirement | EnvVarRequirement | ShellCommandRequirement | ResourceRequirement | SubworkflowFeatureRequirement | ScatterFeatureRequirement | MultipleInputFeatureRequirement | StepInputExpressionRequirement> |
map<class, InlineJavascriptRequirement | SchemaDefRequirement | DockerRequirement | SoftwareRequirement | InitialWorkDirRequirement | EnvVarRequirement | ShellCommandRequirement | ResourceRequirement | SubworkflowFeatureRequirement | ScatterFeatureRequirement | MultipleInputFeatureRequirement | StepInputExpressionRequirement>

array<EnvironmentDef> | map<envNameenvValue | EnvironmentDef>

@mr-c
Copy link
Member Author

mr-c commented Jul 31, 2018

Fixed in #193

@mr-c mr-c closed this as completed Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants