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
The 'dimension' attribute of the /api/projects endpoint (post,patch) should be marked as "readOnly: true" or excluded in the request body schema section.
Current Behaviour
In the api document, the 'dimension' attribute of the /api/projects endpoint (post,patch) is marked as writable.
According to the implementation of the ProjectSerializer class, the 'dimension' field is a read_only field, so I think it should be marked as "readOnly: true" in the api document or excluded from the schema of the request body.
It seems to be due to the characteristic that the read_only_fields Meta option is not referred to in the case of fields explicitly declared in the ModelSerializer. https://stackoverflow.com/questions/68946823/django-drf-read-only-fields-not-working-properly
Possible Solution
Explicitly add "read_only=True" to the 'dimension' declaration code of the ProjectSerializer class.
After modifying the code in the local development environment, I've checked that the changes are as expected as shown below. (Request and Response)
Steps to Reproduce (for bugs)
check the swagger api document (POST /api/projects)
My actions before raising this issue
Expected Behaviour
The 'dimension' attribute of the /api/projects endpoint (post,patch) should be marked as "readOnly: true" or excluded in the request body schema section.
Current Behaviour
In the api document, the 'dimension' attribute of the /api/projects endpoint (post,patch) is marked as writable.
According to the implementation of the ProjectSerializer class, the 'dimension' field is a read_only field, so I think it should be marked as "readOnly: true" in the api document or excluded from the schema of the request body.
It seems to be due to the characteristic that the read_only_fields Meta option is not referred to in the case of fields explicitly declared in the ModelSerializer.
https://stackoverflow.com/questions/68946823/django-drf-read-only-fields-not-working-properly
Possible Solution
Explicitly add "read_only=True" to the 'dimension' declaration code of the ProjectSerializer class.
After modifying the code in the local development environment, I've checked that the changes are as expected as shown below. (Request and Response)
Steps to Reproduce (for bugs)
Context
Your Environment
git log -1
): c52c65cdocker version
(e.g. Docker 17.0.05):Logs from `cvat` container
Next steps
You may join our Gitter channel for community support.
The text was updated successfully, but these errors were encountered: