I want to use path parameters along with format strings.
prefix = 'api/v1'
@router.get(f'{prefix}/{item}')
def get_item(item: str):
return ...
Here, python complains about there not being an item
variable.
Replacing f'{prefix}/{item}
with '%s/{item}' % (prefix)
probably fixes it, but it looks quite ugly, is there a better way to do it?