podhmo / swagger-marshmallow-codegen

generating marshmallow's schema from swagger definition file
MIT License
52 stars 10 forks source link

Dependency `dictknife` is broken #103

Closed Shaokun-X closed 1 year ago

Shaokun-X commented 1 year ago

When I tried to run the program I got:

Traceback (most recent call last):
  File "/Users/shaokunxie/Temp/env/bin/swagger-marshmallow-codegen", line 8, in <module>
    sys.exit(main())
  File "/Users/shaokunxie/Temp/env/lib/python3.7/site-packages/swagger_marshmallow_codegen/cmd.py", line 66, in main
    driver.run(rf, output=args.separated_output)
  File "/Users/shaokunxie/Temp/env/lib/python3.7/site-packages/swagger_marshmallow_codegen/driver.py", line 51, in run
    data = self.load(inp)
  File "/Users/shaokunxie/Temp/env/lib/python3.7/site-packages/swagger_marshmallow_codegen/driver.py", line 31, in load
    return loading.load(fp)
  File "/Users/shaokunxie/Temp/env/lib/python3.7/site-packages/dictknife/loading/__init__.py", line 45, in load
    return load(fp, loader=self, errors=errors)
  File "/Users/shaokunxie/Temp/env/lib/python3.7/site-packages/dictknife/loading/yaml.py", line 6, in load
    return m.yaml.load(fp, **kwargs)
  File "/Users/shaokunxie/Temp/env/lib/python3.7/site-packages/dictknife/loading/_lazyimport.py", line 64, in load
    return json.load(*args, **kwargs)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 296, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 361, in loads
    return cls(**kw).decode(s)
TypeError: __init__() got an unexpected keyword argument 'loader'

Then I downgraded dictknife from 0.14.0 to 0.13.0, the problem was solved.

Maybe the implementation should updated, or the version of dictknife should be fixed.

podhmo commented 1 year ago

Ah, This is behavior is yaml module cannot be imported. (redirecting to json module, but this is not support loader argument).

Anyway, I'll fix it.

podhmo commented 1 year ago

work-around pip install dictknife[load]

podhmo commented 1 year ago

0.6.5 is released