Легкие задачки в опенсорсе из мира Python
Чат: @opensource_findings_chat
Post #347
159
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Improve testing of complex type-forms (#1460)
We test quite a lot of type forms in our tests. But, we never test code like:
This must define the correct component parser for
For all the serializers.
One more thing: union type with
I think that there can be bugs in this code, see
Please, add tests first. Then fix bugs if present. Feel free to discuss the design if needed.
#feature #help_wanted #opensource_september #django_modern_rest
sent via relator
📝 Improve testing of complex type-forms (#1460)
We test quite a lot of type forms in our tests. But, we never test code like:
type UserBody = Body[User]
class MyController(...):
def post(self, parsed_body: UserBody) -> str: ...
This must define the correct component parser for
Body. The same should be tested with UserBody: TypeAlias = Body[User]For all the serializers.
One more thing: union type with
ResponseSpecMetadata.class MyController(...):
def get(self) -> Annotated[UserModel, ResponseSpecMetadata(headers={'X-Id': HeaderSpec()})] | str: ...
I think that there can be bugs in this code, see
unwrap_annotation in litestar on how we can properly unwrap all annotations and get the metadata.Please, add tests first. Then fix bugs if present. Feel free to discuss the design if needed.
#feature #help_wanted #opensource_september #django_modern_rest
sent via relator