Open suecharo opened 5 months ago
A first comment is: why are you reverting a typed CWL object into an untyped Python dictionary using save? Wouldn't it be safer and more reliable to rely directly on CWL Python objects?
Thank you for your comment.
I somewhat understand that the inputs object is a cwl.InputParameter. However, considering the load_document_by_uri interface, which is defined as follows:
def load_document_by_uri(
path: Union[str, Path],
loadingOptions: Optional[LoadingOptions] = None,
load_all: bool = False,
) -> Any:
It returns Any, which makes me wonder if it's difficult to implement something using a safer and more reliable type. I know I could use casting, but that seems counterproductive.
If there's a better approach, I would appreciate your guidance.
Thank you @suecharo ! Yes, this would be useful. Could you please open a PR? Then we all can work on it together there.
Hi CWL community,
I'm reaching out to share some thoughts that emerged from a recent discussion within the Japan community (@inutano, @tom-tan) regarding the development of JSON schemas for workflow parameter files. Specifically, we're looking at creating JSON schemas that corresponds to the YAML templates generated by
cwltool --make-template
.While the templates created by
cwltool --make-template
are incredibly useful, I believe that a JSON schema would be more suitable for generating forms for expected workflow inputs and representing workflow parameters in Workflow Execution Services (WES). (Ref.: nf-core - rnaseq - schema_input.json)To address this, I have drafted a preliminary Python function snippet:
This function is capable of generating a JSON schema like the following example (https://raw.githubusercontent.com/common-workflow-language/cwl-v1.2/main/tests/bwa-mem-tool.cwl):
I am aware that there may be deficiencies, such as a lack of comprehensive test cases. Therefore, I am eager to receive feedback on this implementation approach and any other suggestions you may have.