-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support PEP-585 style collection type hints for OpenAPI? #257
Comments
Hi @kevlarr, |
Makes a lot of sense! Honestly, I think support for 3.7+ is way more important than the convenience of skipping an import, and using If you wanted, I could spike on this for a bit?
Meanwhile, I don't understand how you even found (or made) the time to be so productive as to write a framework! |
@kevlarr thank you for your kind words! 😄 To give a hint of how much time I dedicated to OSS contributions, one of my first contributions here in GitHub has been a simple tool to convert pictures into Base64 encoded strings: https://github.com/RobertoPrevato/Base64 Fixing this particular issue was simple, and I verified that BlackSheep already supports Thank You for offering your help, I welcome contributions in general, in this case I already had an idea to try and it worked immediately. |
Support for PEP 604 -> #261 |
@RobertoPrevato Wow, that's incredible - I honestly would not have expected these to be addressed, given how minor they are. I know how tough it can be to make time for open-source or any kind of project outside of work hours. Thank you for the hard work, I hope you're able to restore the work/life balance and get some (I'm sure) well-deserved time off. |
I'm newly discovering BlackSheep and really liking it so far! (Especially being able to use simple data classes for OpenAPI generation.)
PEP-585 adds support for generics syntax to standard collection types in Python 3.9+, eg.
list
andset
so that we don't need to use their equivalents from thetyping
module.I had hoped the following could work:
But, on server startup, I receive the following error:
If I instead
import typing
and change...... to...
... then the server starts and I can load the docs.
The
age
field is hidden unless I changeint | None
totyping.Optional[int]
but that's a separate issue for a different PEP.The text was updated successfully, but these errors were encountered: