Skip to content

Argument fastapi_kwargs does not cascade down FastAPI object stack #10

@ptomasula

Description

@ptomasula

Describe the bug
The fastapi_kwargs argument added with PR #9, is intended to allow users to set kwargs for the FastAPI instance created by the create_app function.

However, this library appears to be spinning up additional instance of FastAPI without provide those instances those keyword arguments. This leads to incorrect behavior, for example setting a root_path when behind a proxy; The root FastAPI instance will correctly handle url prefixes, but nested endpoints (handled by one of these other FastAPI instances) will not.

To Reproduce
Steps to reproduce the behavior:

  1. Run application behind a proxy.
  2. Set root_api parameter using fastapi_kwargs arugment.
  3. Issue call against docs (/{root_path}/docs/ to verify proxy correctly serves JS.
  4. Issue call against item in catalogs (/{root_path}/docs/{catalog}).
  5. Reroute from catalog pathway will not have root_path included..

Expected behavior
The root_path (prefix) should be included in urls handled by the other FastAPI instances.

cc: @aufdenkampe @sjordan29

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions