TGViewer
Находки в опенсорсе: Python Находки в опенсорсе: Python @opensource_findings_python · 1.06K subscribers
Post #359 179
🚀 New issue to wemake-services/django-modern-rest by @sobolevn
📝 Test and document that default values for components are supported (#1494)


Currently we don't ever test or document that a code like this:

from dmr import Body, Controller
from dmr.plugins.pydantic import PydanticSerializer


class MyController(Controller[PydanticSerializer]):
def post(
self,
parsed_body: Body[dict[str, str] | None] = None,
) -> str:
print(parsed_body)
return 'done'

is even supported.

What is important here?

1. We must call the endpoint function as-is, without any work from our part. Defaults must be real python defaults. And work the same way
2. But, if there are default for Body, we must issue required: false schema for the whole body

Snapshot test is required for this change.


#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 →