Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated and Duplicated Serializer #523

Closed
dedenbangkit opened this issue Jun 28, 2022 · 2 comments
Closed

Deprecated and Duplicated Serializer #523

dedenbangkit opened this issue Jun 28, 2022 · 2 comments

Comments

@dedenbangkit
Copy link
Member

dedenbangkit commented Jun 28, 2022

Warning #0: list_administration: ListAdministrationSerializer: unable to resolve type hint for function "get_children_level_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #1: list_users: UserList: ListUserSerializer: role: Encountered 2 components with identical names "role" and different classes <class 'rest_framework.serializers.role'> and <class 'rest_framework.serializers.role'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #2: list_users: UserList: ListUserSerializer: unable to resolve type hint for function "get_invite". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #3: forgot_password: Response: Encountered 2 components with identical names "Response" and different classes <class 'rest_framework.serializers.Response'> and <class 'rest_framework.serializers.Response'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #4: add_user: Response: Encountered 2 components with identical names "Response" and different classes <class 'rest_framework.serializers.Response'> and <class 'rest_framework.serializers.Response'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #5: verify_invite: Response: Encountered 2 components with identical names "Response" and different classes <class 'rest_framework.serializers.Response'> and <class 'rest_framework.serializers.Response'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #6: list_organisations: OrganisationListSerializer: OrganisationAttributeSerializer: unable to resolve type hint for function "get_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #7: OrganisationEditDeleteView: Response: Encountered 2 components with identical names "Response" and different classes <class 'rest_framework.serializers.Response'> and <class 'rest_framework.serializers.Response'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #8: add_organisation: Response: Encountered 2 components with identical names "Response" and different classes <class 'rest_framework.serializers.Response'> and <class 'rest_framework.serializers.Response'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #9: list_form: ListFormSerializer: unable to resolve type hint for function "get_type_text". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #10: form_approver: FormApproverResponseSerializer: FormApproverUserListSerializer: unable to resolve type hint for function "get_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #11: edit_form_approval: EditApproval: Encountered 2 components with identical names "EditApproval" and different classes <class 'rest_framework.serializers.EditApproval'> and <class 'rest_framework.serializers.EditApproval'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #12: FormDataAddListView: DataList: ListFormDataSerializer: unable to resolve type hint for function "get_created_by". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #13: FormDataAddListView: DataList: ListFormDataSerializer: unable to resolve type hint for function "get_updated_by". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #14: FormDataAddListView: DataList: ListFormDataSerializer: unable to resolve type hint for function "get_created". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #15: FormDataAddListView: DataList: ListFormDataSerializer: unable to resolve type hint for function "get_updated". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #16: FormDataAddListView: DataList: ListFormDataSerializer: unable to resolve type hint for function "get_pending_data". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #17: FormDataAddListView: SubmitFormSerializer: SubmitFormDataAnswerSerializer: could not resolve serializer field "UnvalidatedField(allow_null=False)". Defaulting to "string"
Warning #18: FormDataAddListView: FormSubmit: Encountered 2 components with identical names "FormSubmit" and different classes <class 'rest_framework.serializers.FormSubmit'> and <class 'rest_framework.serializers.FormSubmit'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #19: DataAnswerDetailDeleteView: ListDataAnswerSerializer: unable to resolve type hint for function "get_history". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #20: DataAnswerDetailDeleteView: ListDataAnswerSerializer: unable to resolve type hint for function "get_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #21: PendingFormDataView: PendingDataList: ListPendingFormDataSerializer: unable to resolve type hint for function "get_created_by". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #22: PendingFormDataView: PendingDataList: ListPendingFormDataSerializer: unable to resolve type hint for function "get_created". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #23: PendingFormDataView: PendingDataList: ListPendingFormDataSerializer: unable to resolve type hint for function "get_pending_answer_history". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #24: PendingFormDataView: SubmitPendingFormSerializer: SubmitPendingFormDataAnswerSerializer: could not resolve serializer field "UnvalidatedField(allow_null=False)". Defaulting to "string"
Warning #25: PendingFormDataView: PendingFormSubmit: Encountered 2 components with identical names "PendingFormSubmit" and different classes <class 'rest_framework.serializers.PendingFormSubmit'> and <class 'rest_framework.serializers.PendingFormSubmit'>. This will very likely result in an incorrect schema. Try renaming one.
Warning #26: list_pending_batch: PendingDataBatch: ListPendingDataBatchSerializer: unable to resolve type hint for function "get_created_by". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #27: list_pending_batch: PendingDataBatch: ListPendingDataBatchSerializer: unable to resolve type hint for function "get_created". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #28: PendingDataDetailDeleteView: ListPendingDataAnswerSerializer: unable to resolve type hint for function "get_history". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #29: PendingDataDetailDeleteView: ListPendingDataAnswerSerializer: unable to resolve type hint for function "get_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #30: BatchSummaryView: ListBatchSummarySerializer: unable to resolve type hint for function "get_type". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #31: BatchSummaryView: ListBatchSummarySerializer: unable to resolve type hint for function "get_value". Consider using a type hint or @extend_schema_field. Defaulting to string.
Error #0: BatchView: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Error #1: export_form_data: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Ignoring view for now.
Warning #32: get_map_data_point: ListMapDataPointSerializer: unable to resolve type hint for function "loc". Consider using a type hint or @extend_schema_field. Defaulting to string.
Warning #33: get_map_data_point: ListMapDataPointSerializer: unable to resolve type hint for function "get_marker". Consider using a type hint or @extend_schema_field. Defaulting to string.

Related Issue:

@dedenbangkit
Copy link
Member Author

OpenAPITypes

@dedenbangkit
Copy link
Member Author

dedenbangkit commented Jun 28, 2022

λ ag -G 'serializers.py' "\n    def get_"
api/v1/v1_jobs/serializers.py
28:
29:    def get_type(self, instance):
31:
32:    def get_status(self, instance):

api/v1/v1_data/serializers.py
162:    @extend_schema_field(AnswerHistorySerializer(many=True))
163:    def get_history(self, instance):
171:    @extend_schema_field(OpenApiTypes.ANY)
172:    def get_value(self, instance: Answers):
202:    @extend_schema_field(OpenApiTypes.STR)
203:    def get_created_by(self, instance: FormData):
206:    @extend_schema_field(OpenApiTypes.STR)
207:    def get_updated_by(self, instance: FormData):
212:    @extend_schema_field(OpenApiTypes.STR)
213:    def get_created(self, instance: FormData):
216:    @extend_schema_field(OpenApiTypes.STR)
217:    def get_updated(self, instance: FormData):
219:
220:    def get_pending_data(self, instance: FormData):
257:
258:    def get_marker(self, instance):
263:
264:    def get_shape(self, instance: FormData):
289:    @extend_schema_field(OpenApiTypes.INT)
290:    def get_value(self, instance: QuestionOptions):
365:    @extend_schema_field(AnswerHistorySerializer(many=True))
366:    def get_history(self, instance):
375:    @extend_schema_field(OpenApiTypes.ANY)
376:    def get_value(self, instance: Answers):
397:    @extend_schema_field(OpenApiTypes.STR)
398:    def get_created_by(self, instance: PendingDataBatch):
401:    @extend_schema_field(OpenApiTypes.INT)
402:    def get_total_data(self, instance: PendingDataBatch):
410:                          }))
411:    def get_form(self, instance: PendingDataBatch):
422:                          }))
423:    def get_administration(self, instance: PendingDataBatch):
429:    @extend_schema_field(OpenApiTypes.STR)
430:    def get_created(self, instance: PendingDataBatch):
441:                          }))
442:    def get_approver(self, instance: PendingDataBatch):
496:    @extend_schema_field(OpenApiTypes.STR)
497:    def get_created_by(self, instance: PendingFormData):
500:    @extend_schema_field(OpenApiTypes.STR)
501:    def get_created(self, instance: PendingFormData):
504:    @extend_schema_field(OpenApiTypes.BOOL)
505:    def get_pending_answer_history(self, instance: PendingFormData):
695:                          }))
696:    def get_form(self, instance: PendingDataBatch):
707:                          }))
708:    def get_administration(self, instance: PendingDataBatch):
719:                          }))
720:    def get_file(self, instance: PendingDataBatch):
731:    @extend_schema_field(OpenApiTypes.INT)
732:    def get_total_data(self, instance: PendingDataBatch):
743:                          many=True))
744:    def get_approvers(self, instance: PendingDataBatch):
760:    @extend_schema_field(OpenApiTypes.DATE)
761:    def get_created(self, instance):
764:    @extend_schema_field(OpenApiTypes.DATE)
765:    def get_updated(self, instance):
781:
782:    def get_type(self, instance):
784:
785:    def get_value(self, instance: PendingAnswers):
820:                          }))
821:    def get_user(self, instance: PendingDataBatchComments):
827:    @extend_schema_field(OpenApiTypes.DATE)
828:    def get_created(self, instance: PendingDataBatchComments):

api/v1/v1_forms/serializers.py
37:    @extend_schema_field(ListOptionSerializer(many=True))
38:    def get_option(self, instance: Questions):
47:    @extend_schema_field(OpenApiTypes.STR)
48:    def get_type(self, instance: Questions):
59:                          }))
60:    def get_api(self, instance: Questions):
86:                          }))
87:    def get_center(self, instance: Questions):
110:    @extend_schema_field(ListQuestionSerializer(many=True))
111:    def get_question(self, instance: QuestionGroup):
135:                          many=True))
136:    def get_children(self, instance: Administration):
148:    @extend_schema_field(ListQuestionGroupSerializer(many=True))
149:    def get_question_group(self, instance: Forms):
170:    @extend_schema_field(OpenApiTypes.STR)
171:    def get_type_text(self, instance):
183:    @extend_schema_field(ListOptionSerializer(many=True))
184:    def get_option(self, instance: Questions):
194:    @extend_schema_field(OpenApiTypes.STR)
195:    def get_type(self, instance: Questions):
223:    @extend_schema_field(FormDataListQuestionSerializer(many=True))
224:    def get_question(self, instance: QuestionGroup):
237:    @extend_schema_field(FormDataQuestionGroupSerializer(many=True))
238:    def get_question_group(self, instance: Forms):
374:    @extend_schema_field(OpenApiTypes.STR)
375:    def get_name(self, instance: SystemUser):
388:    @extend_schema_field(FormApproverUserSerializer(many=True))
389:    def get_user(self, instance: Administration):
401:                          }))
402:    def get_administration(self, instance: Administration):
405:    @extend_schema_field(FormApproverUserListSerializer(many=True))
406:    def get_user_list(self, instance: Administration):

api/v1/v1_users/serializers.py
31:    @extend_schema_field(OpenApiTypes.STR)
32:    def get_name(self, instance: OrganisationAttribute):
43:    @extend_schema_field(OrganisationAttributeSerializer(many=True))
44:    def get_attributes(self, instance: Organisation):
161:    @extend_schema_field(ListAdministrationChildrenSerializer(many=True))
162:    def get_children(self, instance: Administration):
172:    @extend_schema_field(OpenApiTypes.STR)
173:    def get_children_level_name(self, instance: Administration):
325:    @extend_schema_field(UserAdministrationSerializer)
326:    def get_administration(self, instance: SystemUser):
330:    @extend_schema_field(OrganisationSerializer)
331:    def get_organisation(self, instance: SystemUser):
334:    @extend_schema_field(UserRoleSerializer)
335:    def get_role(self, instance: SystemUser):
341:    @extend_schema_field(OpenApiTypes.STR)
342:    def get_invite(self, instance: SystemUser):
345:    @extend_schema_field(UserFormSerializer(many=True))
346:    def get_forms(self, instance: SystemUser):
387:    @extend_schema_field(UserAdministrationSerializer)
388:    def get_administration(self, instance: SystemUser):
392:    @extend_schema_field(OrganisationSerializer)
393:    def get_organisation(self, instance: SystemUser):
396:    @extend_schema_field(UserRoleSerializer)
397:    def get_role(self, instance: SystemUser):
403:    @extend_schema_field(OpenApiTypes.STR)
404:    def get_name(self, instance):
407:    @extend_schema_field(UserFormSerializer(many=True))
408:    def get_forms(self, instance: SystemUser):
412:    @extend_schema_field(OpenApiTypes.INT)
413:    def get_last_login(self, instance):
454:    @extend_schema_field(OrganisationSerializer)
455:    def get_organisation(self, instance: SystemUser):
458:    @extend_schema_field(UserApprovalAssignmentSerializer(many=True))
459:    def get_approval_assignment(self, instance: SystemUser):
463:    @extend_schema_field(UserFormSerializer(many=True))
464:    def get_forms(self, instance: SystemUser):
468:    @extend_schema_field(OpenApiTypes.INT)
469:    def get_pending_approval(self, instance: SystemUser):
473:    @extend_schema_field(OpenApiTypes.INT)
474:    def get_data(self, instance: SystemUser):
477:    @extend_schema_field(OpenApiTypes.INT)
478:    def get_pending_batch(self, instance: SystemUser):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant