matkapi / postpy2

Postman collection runner library for python
Other
35 stars 15 forks source link

KeyError: 'item' in core.py #18

Open DJStompZone opened 2 years ago

DJStompZone commented 2 years ago
>>> os.listdir()
['.BRAPI.postman_collection.json']
>>> collection=[os.listdir()[0]]
>>> runner = PostPython(collection)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\DJStomp\AppData\Local\Programs\Python\Python310\lib\site-packages\postpy2\core.py", line 35, in __init__
    self.__load()
  File "C:\Users\DJStomp\AppData\Local\Programs\Python\Python310\lib\site-packages\postpy2\core.py", line 40, in __load
    for request in fol['item']:
KeyError: 'item'
papadeltasierra commented 1 year ago

Hitting this too. Looks to me like the collection layout is quite different to that expected by the parsing. If you patch around this you then find that the "name" of a request is at the wrong level too. Has POSTMAN changed the format again and this library not kept up?

papadeltasierra commented 1 year ago

Also see https://github.com/matkapi/postpy2/issues/1 which has a workaround if you rework the POSTMAN collection slightly.