Bug 240

Summary: tosca2doc
Product: Forge Reporter: Thinh Nguyenphu <thinh.nguyenphu>
Component: TOSCA toolsAssignee: admin_forge <cti_support>
Status: CONFIRMED ---    
Severity: enhancement CC: michele.carignani
Priority: Normal    
Version: v1   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Version number of the related document: OpenAPI issue category: ---

Description Thinh Nguyenphu 2019-06-05 21:35:39 CEST
When using "generated_etsi_nfv_sol001_xxx_types.yaml" files from doc2tosca tool to the tosca2doc tool, the expected output result should be a list of type definitions in MS Word document format. 

Instead, error is occured.

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/app/web_app.py", line 37, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.6/dist-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.6/dist-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/app/web_app.py", line 126, in mk_tosca2doc
    tosca2doc.generate_from_file(tosca_def, doc, filepath)
  File "/app/tosca2doc.py", line 173, in generate_from_file
    print_all_types(TEMPLATES[fn], 1, doc)
  File "/app/tosca2doc.py", line 118, in print_all_types
    for data_type in templ[tosca_type]:
TypeError: 'NoneType' object is not iterable
Comment 1 Michele Carignani 2019-06-17 16:30:22 CEST
Thanks for reporting!

The issue is probably caused by syntax errors in the YAML files uploaded.

In fact, there may be a few errors in the original document which are then in the generated files.