AssertionError: Cannot call `.is_valid()` as no `data=` keyword argument was passed when instantiati1. 报错信息2. 报错环境3. 报错原因4. 解决办法5. ps
1. 报错信息AssertionError: Cannot call `.is_valid()` as no `data=` keyword argument was passed when instantiating the serializer instance.2. 报错环境a. django2.2b.drfc. 视图继承了APIView3. 报错原因在使用序列化器的时候,对于get请求,使用了,下列方法进行校验if text.is_valid():b.反序列