-
-
Notifications
You must be signed in to change notification settings - Fork 520
Open
Description
Describe the bug
When specifying parameters in openapi_extras for an endpoint, they will overwrite the existing query parameters with the extra parameters, rather than appending the parameters to the spec.
Versions (please complete the following information):
- Python version: 3.11.5
- Django version: 5.1.8
- Django-Ninja version: 1.4.0
- Pydantic version: 2.11.1
Without openapi_extras
:
class ProductFilters(FilterSchema):
id__in: list[str] | None
@router.get('/', response=ProductSchemaOut)
def get_products(request, filters: ProductFilters = Query(...)):
pass

With openapi_extras
:
class ProductFilters(FilterSchema):
id__in: list[str] | None
@router.get(
'/',
response=ProductSchemaOut,
openapi_extra={
'parameters': [
{
'in': 'header',
'name': 'X-AUTH-LOGIN',
'shema': {'type': 'string'},
'required': True,
'description': 'Application name',
},
{
'in': 'header',
'name': 'X-AUTH-TOKEN',
'shema': {'type': 'string'},
'required': True,
'description': 'Application key',
},
]
},
)
def get_products(request, filters: ProductFilters = Query(...)):
pass

Notice that id__in
query parameter is gone.
OscarVanL and jhassine
Metadata
Metadata
Assignees
Labels
No labels