English
Open in Telegram

Post 🚀 New issue to wemake-services/django-modern-rest by @kondratevdev

1 September 2026
W
wps_forward_bot
🚀 New issue to wemake-services/django-modern-rest by @kondratevdev 📝 Strict boolean `Query` component cannot parse valid OpenAPI boolean values (#1325) What's wrong? Boolean query parameters cannot be parsed correctly when using Pydantic strict validation, even though DMR generates a valid OpenAPI schema for them. For example: from pydantic import BaseModel, StrictBool class ProjectsQuery(BaseModel): random: StrictBool = False DMR generates the expected OpenAPI schema: - name: random in: query schema: type: boolean default: false However, a valid request: GET /projects?random=false is rejected with 400 Bad Request: { "detail": [ { "msg": "Input should be a valid boolean", "loc": ["parsed_query", "random"], "type": "value_error" } ] } Schemathesis detects this as a schema-compliant request being rejected: API rejected schema-compliant request Valid data should have been accepted Expected: 2xx, 401, 403, 404, 409, 5xx [400] Bad Request Reproduce with: curl -X GET --insecure \ 'http://localhost/api/projects/projects/?random=false' Why not use a regular bool? A regular Pydantic bool successfully parses query parameters: class ProjectsQuery(BaseModel): random: bool = False So these work as expected: ?random=true -> True ?random=false -> False However, Pydantic's non-strict boolean parsing also accepts other representations: ?random=1 -> True ?random=0 -> False This makes the actual API validation more permissive than the generated OpenAPI schema. How it should be? Maybe it should be possible to use strict boolean validation for query parameters while still accepting their valid HTTP/OpenAPI representation? Used versions 0.14.0 OS information Not important for this case (please, do not take this issue before the 1st of September) #bug #good_first_issue #help_wanted #openapi #opensource_september #django_modern_rest sent via relator
1 · 163 ·

Nearby in the feed

Wwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `RedirectTo` accepts protocol-relative URLs (#1326) django-modern-rest/dmr/response.py Lines 16Wwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 `@sensitive_variables` decorator is missing on auth views (#1323) We already have @endpoint_dec
this message
Wwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 The JWT blocklist is silently bypassed by tokens without a `jti` (#1322) There are two problem Wwps_forward_bot🚀 New issue to wemake-services/django-modern-rest by @sobolevn 📝 Make sure that `SSE` validation for events work correctly, including custom types and `validate
ННаходки в опенсорсе: PythonНаходки в опенсорсе: Python@opensource_findings_python · channel · Tech
1 052subscribers369average post reach
Venue feed Open in Telegram

An open public feed from the search index ChatCrawler — “Google for public Telegram”; refreshed as the venue is crawled. Times are UTC.

Public content only, official Telegram API. About · FAQ · Index limits · Remove a page · Catalog · Search · How we count