postdown / Postdown

Generate markdown API document from Postman.
GNU General Public License v3.0
76 stars 26 forks source link

Does not work if there is a blank description #4

Open cdgriffith opened 5 years ago

cdgriffith commented 5 years ago

https://github.com/TitorX/Postdown/blob/master/postdown/parser.py#L21

Should be updated to use .get('description', '')

jonasbn commented 5 years ago

I observe this issue too, this is the error message.

Traceback (most recent call last):
  File "/usr/local/bin/postdown", line 10, in <module>
    sys.exit(execute())
  File "/usr/local/lib/python2.7/site-packages/postdown/cmdline.py", line 14, in execute
    parse(in_file, out_file)
  File "/usr/local/lib/python2.7/site-packages/postdown/parser.py", line 34, in parse
    doc.block(request['description'])
KeyError: 'description'
samcrane8 commented 5 years ago

I'm currently waiting for TitorX to review my pull request, but in the meantime you can checkout my fork here, it handles this issue.

It's not on pip though so you have to clone the source.

askme-gpt commented 4 years ago

I solved this bug ,and become it a pip package. https://github.com/ShuiPingYang/YspPostdown

Gauhar commented 3 years ago

@ShuiPingYang - This is still happening for me and I am getting the following error:

File "/opt/homebrew/bin/postdown", line 8, in <module>
    sys.exit(execute())
  File "/opt/homebrew/lib/python3.9/site-packages/postdown/cmdline.py", line 14, in execute
    parse(in_file, out_file)
  File "/opt/homebrew/lib/python3.9/site-packages/postdown/parser.py", line 21, in parse
    doc.line(collection['info']['description'])
KeyError: 'description'

On parser.py line 21 still expects to have description

rows = get_rows(
            request['url']['query'],
            ['key', 'value', 'description']
        )
jonasbn commented 3 years ago

@Gauhar I think @ShuiPingYang has released a (new) separate package: ysp-postdown

See pypi.org, so this package (Postdown) has not been updated, but there is an alternative (ysp-postdown).

davidnierman commented 2 years ago

I am getting this error with ysp-postdown

Traceback (most recent call last):
  File "/usr/local/bin/ysp_postdown", line 8, in <module>
    sys.exit(execute())
  File "/usr/local/lib/python3.9/site-packages/ysp_postdown/cmdline.py", line 14, in execute
    parse(in_file, out_file)
  File "/usr/local/lib/python3.9/site-packages/ysp_postdown/parser.py", line 42, in parse
    request = api['request']
KeyError: 'request'