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
I'm using the extend_schema to specify a request body that is simply an array of integers, however in the generated schema (no errors or warning were displayed during the generation) the request body is simply omitted.
To Reproduce
@extend_schema(
operation_id='batch_delete_material',
summary='Batch Delete Material',
description="""Performs batch delete of materials records. The request body must be a an array of ids.""",
request={
"type": "array",
"items": {"type": "integer"}
},
responses=common_types.BATCH_JOB_RESPONSES
)
@action(methods=['DELETE'], detail=False)
def batch_delete_method(self, request):
return super().batch_delete_method(request)
generates this schema:
"/api/v1/batch_delete_method/": {
"delete": {
"operationId": "batch_delete_material",
"description": "Performs batch delete of materials records. The request body must be a an array of ids.",
"summary": "Batch Delete Material",
"tags": [
"Global Configuration"
],
"security": [
{
"jwtAuth": []
},
{
"tokenAuth": []
}
],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "uuid"
}
}
}
}
},
"description": "Successful response."
}
}
}
},
Expected behavior
I expected there to be a requestBody parameter with an appropriate schema such as:
Describe the bug
I'm using the extend_schema to specify a request body that is simply an array of integers, however in the generated schema (no errors or warning were displayed during the generation) the request body is simply omitted.
To Reproduce
generates this schema:
Expected behavior
I expected there to be a requestBody parameter with an appropriate schema such as:
The text was updated successfully, but these errors were encountered: