Encrypt and decrypt the data that can be seens in the Swagger of the Django when making any Rest API
I am making a django project and using DRF to make the API's also using the Swagger UI to make it interactive for the backend testing Image of the Swagger Request which can be seen
So in this image i want to make the "-d" to be encrypted and also in the frontend when i want to encrypt the data when you go see it in the networks also decrypt the data when API is using making the CRUD operations with the database.
I am using the serializers here.
How can i implement the encryption and make changes in the serializers or the curl "-d" option so that i can only see the encrypted Data in swagger. Shall i make a middleware to encrypt the data?
How i can also encrypt the data whenever my response is being given by the API. So that on frontend when using inspect it is encrypted Data.
Thanks in Advance and for your suggestion to make my project better and secure!!