Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for importing a package #104

Merged
merged 3 commits into from
Jun 26, 2017

Conversation

talitarossari
Copy link
Contributor

Adding support for importing a package installed by pip

@coveralls
Copy link

coveralls commented May 22, 2017

Coverage Status

Coverage decreased (-0.8%) to 81.359% when pulling be6474c on talitarossari:master into 3464ef1 on rochacbruno:master.

@rochacbruno
Copy link
Member

Looks like this is the same problem of #102

I am going to write some tests for it and then merge your PR..

Thanks

@rochacbruno
Copy link
Member

rochacbruno commented May 23, 2017

Steps needed to test this

@coveralls
Copy link

coveralls commented Jun 5, 2017

Coverage Status

Coverage decreased (-0.8%) to 81.359% when pulling 8f309c3 on talitarossari:master into c5d3313 on rochacbruno:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 81.359% when pulling 129322d on talitarossari:master into c5d3313 on rochacbruno:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 81.359% when pulling 129322d on talitarossari:master into c5d3313 on rochacbruno:master.

@coveralls
Copy link

coveralls commented Jun 5, 2017

Coverage Status

Coverage decreased (-0.9%) to 81.217% when pulling 00463aa on talitarossari:master into c5d3313 on rochacbruno:master.

@rochacbruno rochacbruno merged commit 00463aa into flasgger:master Jun 26, 2017
@rochacbruno
Copy link
Member

@talitarossari still need help to reproduce the error.

Take a look at etc/flasgger_package and tests/package_example

Can you reproduce your case there?

@talitarossari
Copy link
Contributor Author

@rochacbruno, sorry for waiting.
I was able to reproduce my situation (import the .yml from an external package).
For this, I needed to create another file "parameters.yml" and import it out of the package.
The error did not persist.
Pull requests #135

@ryanermita
Copy link

I found this issue thru the comment in flasgger/utils.py line 466 while im following the stack trace error.

I had an issue importing .yml files using swag_from() from different directory.
I found out that it changes the path or retrieving the .yml files from another directory.
In my case the .yml file directory became relative_path/utils/path_to_swagger/my.yml instead of relative_path/path_to_swagger/my.yml

to fix this issue on my end, I define the relative path of my .yml documentation.

# because my swagger docs is the same path as my api module.
BASE_SWAGGER_DOCS_PATH = os.path.dirname(__file__) + '/docs/swagger'`

@swag_from('%s/my.yml' % BASE_SWAGGER_DOCS_PATH)
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants