alysivji / falcon-apispec

apispec plugin that generates OpenAPI specification (aka Swagger Docs) for Falcon web applications.
MIT License
44 stars 31 forks source link

example not working - missing dependency #21

Closed jitka closed 4 years ago

jitka commented 4 years ago

Hi,

I am using Fedora 31, Python 3.7.7

I install falcon-apispec by pip

$ pip install falcon-apispec
Requirement already satisfied: falcon-apispec in /home/jitka/.env/taxonomy/lib/python3.7/site-packages (0.4.0)
Requirement already satisfied: falcon in /home/jitka/.env/taxonomy/lib/python3.7/site-packages (from falcon-apispec) (2.0.0)
Requirement already satisfied: apispec>=1.0 in /home/jitka/.env/taxonomy/lib/python3.7/site-packages (from falcon-apispec) (3.3.0)
Requirement already satisfied: PyYAML>=3.10 in /home/jitka/.env/taxonomy/lib/python3.7/site-packages (from falcon-apispec) (5.3)

and run example from readme and got:

Traceback (most recent call last):
  File "swagger.py", line 2, in <module>
    from apispec.ext.marshmallow import MarshmallowPlugin
  File "/home/jitka/.env/taxonomy/lib64/python3.7/site-packages/apispec/ext/marshmallow/__init__.py", line 74, in <module>
    from .common import resolve_schema_instance, make_schema_key, resolve_schema_cls
  File "/home/jitka/.env/taxonomy/lib64/python3.7/site-packages/apispec/ext/marshmallow/common.py", line 7, in <module>
    import marshmallow
ModuleNotFoundError: No module named 'marshmallow'

I add it manually pip install marshmallow and it solves the problem and example is working.

alysivji commented 4 years ago

We can create API documentation without Marshmallow. In the quickstart, I have labeled this section as Optional Marshmallow Support.

Would appreciate a suggestion on how I can make this more clear. Maybe moving / copying this comment to appear on the import line?

jitka commented 4 years ago

I would apprreciate a shorter quickstart and then special section about Marshmallow.

jitka commented 4 years ago

Or alternativly you can mention Mashmallow in istalation section.

alysivji commented 4 years ago

Look at the docs for apispec, they mention marshmallow with a link. That sounds like the right approach.

I will put this on my todo list for this weekend. Would also appreciate a PR if you have time.

Thanks for reporting the issue!

jitka commented 4 years ago

https://github.com/alysivji/falcon-apispec/pull/22

My English is not perfect but I hope this will help new users get faster orientation.

alysivji commented 4 years ago

Thank you @jitka for updating the README! It's a lot more clear!