Giter VIP home page Giter VIP logo

Comments (9)

alufers avatar alufers commented on May 11, 2024

Looks like a mismatched version of mitmproxy. I will have to update the dependency and check it.

from mitmproxy2swagger.

AndreiUlmeyda avatar AndreiUlmeyda commented on May 11, 2024

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.

alufers avatar alufers commented on May 11, 2024

I think so

from mitmproxy2swagger.

pdlloyd avatar pdlloyd commented on May 11, 2024

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.

zkxjzmswkwl avatar zkxjzmswkwl commented on May 11, 2024

Same issue.

from mitmproxy2swagger.

rarestg avatar rarestg commented on May 11, 2024

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.

strangelydim avatar strangelydim commented on May 11, 2024

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.

alufers avatar alufers commented on May 11, 2024

Good catch! Sorry for taking so long, I forgot about this issue. I will fix it ASAP.

from mitmproxy2swagger.

alufers avatar alufers commented on May 11, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.