Skip to content

terminate called after throwing an instance of 'YAML::BadSubscript' #12

@mr-c

Description

@mr-c

error message:

terminate called after throwing an instance of 'YAML::BadSubscript'
  what():  yaml-cpp: error at line 4, column 17: operator[] call on a scalar (key: "id")
Aborted

test program:

#include "cwl_v1_2.h"

#include <iostream>

/**
 * This test program creates loads and prints a CWL description.
 *
 * It assumes that printing to stdout works (see cwl_output_example).
 * It loads a CWL description from a file and populates C++ classes.
 */


// using shortened cwl:: namespace instead of https___w3id_org_cwl_cwl
namespace cwl = https___w3id_org_cwl_cwl;

int main(int argc, char** argv) {
    if (argc != 2) return 1;

    auto yaml = YAML::LoadFile(argv[1]);
    auto tool = cwl::Workflow{};
    fromYaml(yaml, tool);

    auto y = toYaml(tool);

    YAML::Emitter out;
    out << y;
    std::cout << out.c_str() << "\n";

    return 0;
}

CWL test file

cwlVersion: v1.2
class: Workflow
inputs:
 09first_input: string
 05second_input: int
 01third_input: File
steps:
 zz_step_one:
   run:
     class: ExpressionTool
     inputs: []
     outputs: []
     expression: ${return {}; }
     requirements:
       InlineJavascriptRequirement: {}
   in: []
   out: []
 00_step_two:
   out: []
   run:
     inputs: []
     requirements:
       InlineJavascriptRequirement: {}
     outputs: []
     expression: ${return {}; }
     class: ExpressionTool
   in: []
outputs:
  zz_first_output:
    type: File
    outputSource: 01third_input
  ll_second_output:
    type: string
    outputSource: 09first_input
  aa_third_output:
    type: int
    outputSource: 05second_input

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions