litestar-users icon indicating copy to clipboard operation
litestar-users copied to clipboard

feat: allow identifier URI customization

Open cofin opened this issue 1 year ago • 2 comments

This PR enables the customization of the name and type of the identifier URI for the user_management_handler_config and role_management_handler_config route generators.

cofin avatar Dec 16 '23 21:12 cofin

Thanks for this, I'm currently on leave and will give it proper eyes once I'm back

I'm curious to see the behaviour when the path param name doesn't match the variable name. This setting effectively allows this:

@post("/some/path/{foo:uuid}")
def add_user(id_: UUID, ...) -> User:
    ...

In which case id_ will just be registered as a query param?

LonelyVikingMichael avatar Dec 24 '23 18:12 LonelyVikingMichael

Thanks for this, I'm currently on leave and will give it proper eyes once I'm back

I'm curious to see the behaviour when the path param name doesn't match the variable name. This setting effectively allows this:

@post("/some/path/{foo:uuid}")
def add_user(id_: UUID, ...) -> User:
    ...

In which case id_ will just be registered as a query param?

Good question. I intended to add a few tests to this before the break, but I ran out of time.

There's one additional feature that I would like to see implemented, but I'll ping you in discord re: the best approach for this.

cofin avatar Dec 26 '23 15:12 cofin

Closing this as I believe this was handled some months ago.

LonelyVikingMichael avatar Jan 06 '25 12:01 LonelyVikingMichael