Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninitialized OrderedDict in hug.interface.Local.documentation() #834

Closed
defrank opened this issue Jan 9, 2020 · 1 comment
Closed

Uninitialized OrderedDict in hug.interface.Local.documentation() #834

defrank opened this issue Jan 9, 2020 · 1 comment

Comments

@defrank
Copy link

@defrank defrank commented Jan 9, 2020

Unable to call .documentation() on a hug.local() interface because the doc OrderedDict is not initialized.


~/.pyenv/versions/3.8.0/lib/python3.8/site-packages/hug/interface.py in documentation(self, add_to)
    316                 for requirement in self.requires
    317             ]
--> 318         doc["outputs"] = OrderedDict()
    319         doc["outputs"]["format"] = _doc(self.outputs)
    320         doc["outputs"]["content_type"] = self.outputs.content_type

TypeError: 'type' object does not support item assignment
306         def documentation(self, add_to=None):
307             """Produces general documentation for the interface"""
308             doc = OrderedDict if add_to is None else add_to
309
310             usage = self.interface.spec.__doc__
311             if usage:
312                 doc["usage"] = usage
313             if getattr(self, "requires", None):
314                 doc["requires"] = [
315                     getattr(requirement, "__doc__", requirement.__name__)
316                     for requirement in self.requires
317                 ]
318  ->         doc["outputs"] = OrderedDict()
@mrsaicharan1
Copy link
Contributor

@mrsaicharan1 mrsaicharan1 commented Feb 1, 2020

Hello, I'd like to work on this issue. Will send a PR in a few moments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

2 participants
You can’t perform that action at this time.