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

How to use swagger_from_file when file is in the parent directory? #87

Open
JoabMendes opened this issue Mar 11, 2020 · 1 comment
Open

Comments

@JoabMendes
Copy link

I have the following structure in my project:

project
     ├── core
     │      └── factory.py
     └── docs
             └── swagger.yaml

My core.factory.py loads the swagger.yaml in the build_app function with:

    setup_swagger(
        app,
        swagger_url='/docs',
        swagger_from_file="/../docs/swagger.yaml"
    )

But it crashes the app raising the error gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3> (If I remove setup_swagger it works normally).

I have tried:

  • swagger_from_file="/../docs/swagger.yaml"
  • swagger_from_file="../docs/swagger.yaml"
  • swagger_from_file="docs/swagger.yaml"

And they all have failed. So I came to ask for help on that. Is there a way to load the swagger file when that file is located the parent dir?

@rafa-acioly
Copy link

rafa-acioly commented May 28, 2020

I've the same structure and the swagger_from_file="docs/swagger.yaml" works just fine for me.

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

No branches or pull requests

2 participants