Duke-GCB / bespin-api

Web application for running workflows in the cloud
MIT License
0 stars 2 forks source link

Validation error for dict type #183

Closed johnbradley closed 5 years ago

johnbradley commented 5 years ago

A test workflow https://raw.githubusercontent.com/johnbradley/toyworkflow/master/pair-wc-packed.cwl contains a type definition that is defined as an array of array of Files. "type": { "type": "array", "items": { "type": "array", "items": "File" } }, This fails to validate with a 500 error. Error from the server:

ERROR:django.request:Internal Server Error: /api/v2/job-templates/init/
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/exception.py", line 39, in inner
    response = get_response(request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "/usr/local/lib/python3.6/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/django/views/generic/base.py", line 68, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 474, in dispatch
    response = self.handle_exception(exc)
  File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 434, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/local/lib/python3.6/site-packages/rest_framework/views.py", line 471, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rest_framework/generics.py", line 191, in post
    return self.create(request, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/rest_framework/mixins.py", line 21, in create
    self.perform_create(serializer)
  File "/app/bespin_api_v2/api.py", line 81, in perform_create
    job_template.populate_job_order()
  File "/app/bespin_api_v2/jobtemplate.py", line 93, in populate_job_order
    value = self.create_placeholder_value(field_type['items'], is_array=True)
  File "/app/bespin_api_v2/jobtemplate.py", line 103, in create_placeholder_value
    return [self.create_placeholder_value(type_name, is_array=False)]
  File "/app/bespin_api_v2/jobtemplate.py", line 105, in create_placeholder_value
    placeholder = USER_PLACEHOLDER_DICT.get(type_name)
TypeError: unhashable type: 'dict'
johnbradley commented 5 years ago

This is also an issue with wes-gatk4-preprocessing/v6/b37-human-xgen the same error but with a different type TypeError: unhashable type: 'list'.