drf-yasg
drf-yasg copied to clipboard
Support new X | Y union syntax of Python 3.10 (PEP 604)
This is used, for example, when inspecting the result type of SerializerMethodField
.
This isn't properly tested yet, I ran out of time today. Will during the weekend or next week.
@intgr Did you test it back then properly after your initial comments?
Heh this is awkward. I was actually using drf-spectacular, but submitted a PR for the wrong project. So I never finished this.
I have rebased and pushed my latest changes, but the tests are still failing, so someone else should finalize this.
@intgr thanks for this, it's really helpful. The remaining tasks include adding some tests for a python3.10 environment that uses the union syntax and to add the version to the tox file. I'm going to add the help wanted and first issue labels to entice some contributors.
I already added some tests, but they fail when running with Python 3.10. So some additional changes are needed to the logic. I don't know where it goes wrong.