Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

AttributeError: 'collections.OrderedDict' object has no attribute 'iteritems' from local DRF with swagger docs #8

Description

@RadoRado

I decided to test the following scenario with coredocs:

  1. There's a DRF (latest version)
  2. Added DRF Rest Swagger (latest version)
  3. $ coredocs build "http://localhost:8000/docs?format=openapi" --format openapi results in the following exception:
Fetching schema file from 'http://localhost:8000/docs?format=openapi'.
Traceback (most recent call last):
  File "/home/radorado/code/python-envs/drfjwt/bin/coredocs", line 11, in <module>
    sys.exit(client())
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/click/core.py", line 716, in __call__
    return self.main(*args, **kwargs)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/click/core.py", line 696, in main
    rv = self.invoke(ctx)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/click/core.py", line 1060, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/click/core.py", line 889, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/click/core.py", line 534, in invoke
    return callback(*args, **kwargs)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/coredocs/main.py", line 136, in build
    output_text = render(document, highlight, languages, theme=theme)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/coredocs/main.py", line 54, in render
    schema_format=schema_format
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/jinja2/_compat.py", line 37, in reraise
    raise value.with_traceback(tb)
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/coredocs/themes/slate/templates/index.html", line 44, in top-level template code
    {% include "document.html" %}
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/coredocs/themes/base/templates/document.html", line 5, in top-level template code
    {% for section_key, section in get_sections(document) %}
  File "/home/radorado/code/python-envs/drfjwt/lib/python3.5/site-packages/coredocs/utils.py", line 14, in get_sections
    return sorted(node.data.iteritems(), key=lambda item: item[0])
AttributeError: 'collections.OrderedDict' object has no attribute 'iteritems'

Am I doing something wrong? 🐼

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions