Comments (9)
Looks like a mismatched version of mitmproxy. I will have to update the dependency and check it.
from mitmproxy2swagger.
Aye! Thanks for investigating. Could I, in the meantime, try to run it with mitmproxy 8.0 and have a chance of it working?
from mitmproxy2swagger.
I think so
from mitmproxy2swagger.
FWIW I have this same issue. Downgrading to 8.0 did not solve the issue.
[user@machine]$ mitmproxy2swagger -i flows -o out-schema -p https://web.site/api
No existing swagger file found. Creating new one.
Traceback (most recent call last):
File "/usr/bin/mitmproxy2swagger", line 8, in <module>
sys.exit(main())
File "/usr/lib/python3.10/site-packages/mitmproxy2swagger/mitmproxy2swagger.py", line 121, in main
for f in caputre_reader.captured_requests():
File "/usr/lib/python3.10/site-packages/mitmproxy2swagger/har_capture_reader.py", line 87, in captured_requests
data = json_stream.load(f)
File "/usr/lib/python3.10/site-packages/json_stream/loader.py", line 8, in load
return StreamingJSONBase.factory(token, token_stream, persistent)
File "/usr/lib/python3.10/site-packages/json_stream/base.py", line 28, in factory
raise ValueError(f"Unknown operator {token}") # pragma: no cover
ValueError: Unknown operator 6201
[user@machine]$ mitmproxy --version
Mitmproxy: 8.0.0
Python: 3.10.5
OpenSSL: OpenSSL 1.1.1l 24 Aug 2021
Platform: Linux-5.18.7-1-MANJARO-x86_64-with-glibc2.35
from mitmproxy2swagger.
Same issue.
from mitmproxy2swagger.
Same issue here:
Traceback (most recent call last):
File "/Users/rares/miniforge3/envs/rares/bin/mitmproxy2swagger", line 8, in <module>
sys.exit(main())
File "/Users/rares/miniforge3/envs/rares/lib/python3.9/site-packages/mitmproxy2swagger/mitmproxy2swagger.py", line 121, in main
for f in caputre_reader.captured_requests():
File "/Users/rares/miniforge3/envs/rares/lib/python3.9/site-packages/mitmproxy2swagger/har_capture_reader.py", line 87, in captured_requests
data = json_stream.load(f)
File "/Users/rares/miniforge3/envs/rares/lib/python3.9/site-packages/json_stream/loader.py", line 8, in load
return StreamingJSONBase.factory(token, token_stream, persistent)
File "/Users/rares/miniforge3/envs/rares/lib/python3.9/site-packages/json_stream/base.py", line 28, in factory
raise ValueError(f"Unknown operator {token}") # pragma: no cover
ValueError: Unknown operator 8466
from mitmproxy2swagger.
I just ran into this. Looks like the magical auto-detection of flow vs. har format doesn't work too well and ends up deciding everything is in har format. Note in the originally reported stack trace that despite a flow format file being used, we end up in har_capture_reader.py
code...
In my case, if I just use the -f
option to force the file to be parsed as a flow file, it works for me. Just add -f flow
to your command-line options.
from mitmproxy2swagger.
Good catch! Sorry for taking so long, I forgot about this issue. I will fix it ASAP.
from mitmproxy2swagger.
Hi.
I have fine-tuned the detection. Additionally I have added an error message which suggests you to specify the format manually if the detection fails.
Best regards
from mitmproxy2swagger.
Related Issues (20)
- Flow file corrupted: mitmproxy 9.0.1 cannot read files with flow format version 20, please update mitmproxy. HOT 1
- mitmproxy2swagger stuck HOT 2
- T
- Error thrown at generating spec HOT 2
- can we generate documentation in json format instead of yml
- Error with good mitmproxy version : "Flow file corrupted: mitmproxy 8.1.1 cannot read files with flow format version 18, please update mitmproxy" HOT 3
- Second time run of the tool gives an error HOT 1
- Add support for x-www-form-urlencoded requests
- 'str' object does not support item assignment in mitmproxy2swagger.py HOT 1
- 'str' object does not support item assignment in mitmproxy2swagger.py HOT 1
- Allow later json-stream HOT 3
- Nothing shows up in the output file HOT 10
- Error with parsing urlencoded requests HOT 2
- Cannot convert - TypeError: 'int' object is not subscriptable HOT 2
- TypeError: unsupported operand type(s) for |: '_GenericAlias' and 'NoneType' HOT 5
- Output file is empty HOT 2
- Consider name change to mitmproxy2openapi HOT 1
- Flow file corrupted: mitmproxy 9.0.1 cannot read files with flow format version 20, please update mitmproxy. HOT 2
- No existing swagger file found. Creating new one. HOT 5
- TypeError: 'int' object is not subscriptable HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mitmproxy2swagger.