You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Using the approach described in #1115 to add a description of a parameter, the generated swagger docs break when the example= property is added. The generated API docs show Could not render Parameters, see the console.
Versions (please complete the following information):
Python version: 3.11.6
Django version: 5.1
Django-Ninja version: 1.3.0
Pydantic version: 2.9.2
Example:
from datetime import datetime, timezone
from typing import Annotated
from typing import List
from ninja import Router, Query, Schema, Field
router = Router()
class FilterParams(Schema):
end: Annotated[
datetime,
Field(
examples=[datetime.now(timezone.utc)], # fails when this line is uncommented
description="ISO-formatted timestamp of the latest item to return",
),
]
@router.get(
"",
url_name="list",
response=List[MySchemaOut],
)
def my_list(request, filters: Query[FilterParams]):
pass
The text was updated successfully, but these errors were encountered:
Describe the bug
Using the approach described in #1115 to add a description of a parameter, the generated swagger docs break when the
example=
property is added. The generated API docs showCould not render Parameters, see the console.
Versions (please complete the following information):
Example:
The text was updated successfully, but these errors were encountered: