Skip to content

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

@0xLuz

Description

@0xLuz

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions