TGViewer
Находки в опенсорсе: Python Находки в опенсорсе: Python @opensource_findings_python · 1.06K subscribers
Post #358 170
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Change how we work with `FileMetadata` validation (#1493)


Currently, this code is allowed:

from typing import Literal

import pydantic

from dmr import Body, Controller, FileMetadata
from dmr.plugins.pydantic import PydanticSerializer
from dmr.parsers import JsonParser, MultiPartParser


class Text(pydantic.BaseModel):
content_type: Literal['text/plain']


class Files(pydantic.BaseModel):
text: Text


class MyController(Controller[PydanticSerializer]):
parsers = [JsonParser(), MultiPartParser()]

def post(
self,
parsed_body: Body[dict[str, str]],
parsed_file_metadata: FileMetadata[Files],
) -> str:
return 'done'

But, how can we ever satisfy?

JsonParser()
parsed_file_metadata: FileMetadata[Files]

It is not optional. Every request here will fail.
What we can do? Change

django-modern-rest/dmr/components.py

Lines 866 to 889 in f822e35

from any to all.


#bug #good_first_issue #help_wanted #opensource_september #django_modern_rest
sent via relator
More from @opensource_findings_python
  1. Sep 17, 2026Помните про https://github.com/ozeranskii/httptap? Я писал о нем давно еще - > тут. Наклеп…
  2. Sep 15, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `test_custom_union_form…
  3. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @milssky 📝 Changes in benchmarking…
  4. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Fix `operation_id` defa…
  5. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Fix unused `security` f…
  6. Sep 13, 2026🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Test explicit `OpenAPIC…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →