[BUG] OpenAPI 方案为查询参数生成无效的 `examples` 格式,导致 Swagger UI 无法正常工作
作者: Xdynix创建于 2025年12月30日更新于 2026年4月24日
Describe the bug
When using Pydantic's examples field on query parameters, Django Ninja copies the JSON Schema array format directly to the OpenAPI Parameter Object level. However, OpenAPI 3.1.0 requires examples at the Parameter Object level to be a map of Example Objects, not an array. This causes Swagger UI to fail with TypeError: i.get is not a function when rendering the parameters.
内容来源: vitalik/django-ninja