DeanWay / fastapi-versioning

api versioning for fastapi web applications
MIT License
650 stars 63 forks source link

Use functools.wraps for decorator #11

Closed HacKanCuBa closed 3 years ago

HacKanCuBa commented 4 years ago

Implement functools.wraps in the version decorator to avoid breaking tab completion and breaking wrapped function signature:

https://github.com/DeanWay/fastapi-versioning/blob/875863c0a312e4d30ecbb351abc3e145fa203b62/fastapi_versioning/versioning.py#L12

DeanWay commented 3 years ago

I believe this is addressed in #32. In particular your editor may have misunderstood the type of a function annotated with @version since the version function was missing a return type annotation

HacKanCuBa commented 3 years ago

I believe this is addressed in #32. In particular your editor may have misunderstood the type of a function annotated with @version since the version function was missing a return type annotation

Yes, I would say it's fixed given #32 adds said annotations.