fastapi-utils icon indicating copy to clipboard operation
fastapi-utils copied to clipboard

Fixed 'None' and 'NoReturn' bug in inferring router.

Open synchronizing opened this issue 3 years ago • 2 comments

Fixes #172.

Note that the comparison must be done using type since None is a special typehint case. Python documentation states:

Note that None as a type hint is a special case and is replaced by type(None)."

Referenced here.

synchronizing avatar Mar 04 '21 16:03 synchronizing

@dmontagu Any chance you could take a look at this?

synchronizing avatar Mar 17 '21 16:03 synchronizing

I have slayed this bug in this PR

yuval9313 avatar Feb 12 '22 19:02 yuval9313

Closing this now that this return type annotation is used in newer versions of FastAPI.

Please let me know if this addresses other issues not handled by FastAPI and I should re-add support.

dmontagu avatar Mar 19 '23 18:03 dmontagu