Skip to content

API Versioned URL outside of api_v1 directory #392

@mark-meyer

Description

@mark-meyer

/app/api/deps.py has a hardcoded and versioned url that lives outside the versioning setup of the api.

reusable_oauth2 = OAuth2PasswordBearer(
    tokenUrl=f"{settings.API_V1_STR}/login/access-token"
)

This is loaded as a dependency of get_current_user() which is then imported into the versioned endpoints (i.e. app/api/api_v1/endpoints/). Maybe I'm missing something, but this seems like a mistake. It's not clear how one would then add a API_V2 and continue to use this arrangement without duplicating and moving get_current_user().

Do you have any guidance for this when bumping the api up to the next version?

Metadata

Metadata

Assignees

No one assigned

    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