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

Replace django-rest-swagger with drf-spectacular #698

Open
afuetterer opened this issue Sep 9, 2023 · 16 comments
Open

Replace django-rest-swagger with drf-spectacular #698

afuetterer opened this issue Sep 9, 2023 · 16 comments
Assignees
Milestone

Comments

@afuetterer
Copy link
Member

afuetterer commented Sep 9, 2023

Rationale / Begründung

django-rest-swagger is deprecated since 2019. Should rdmo switch to an alternative openapi library? drf-spectacular looks promising.

Affected

Software group

References / Verweise

@afuetterer
Copy link
Member Author

afuetterer commented Jul 11, 2024

Using django-rest-swagger

image


Using drf-spectacular

@afuetterer
Copy link
Member Author

@jochenklar @MyPyDavid: Do you know, if the swagger UI used or is this just for convenience?

I want to switch out the deprecated library, that generates 100+ warnings when running the tests.

Is it important to generate the exact same UI under the exact same URL?

@jochenklar
Copy link
Member

Hi @afuetterer thanks for the effort! No I don't think we need swagger, I never liked it anyway. But I guess we need something like this, meaning a browsable API explorer thingy.

@afuetterer
Copy link
Member Author

Alright, thanks.

drf-spectacular generates the openapi schema in json/yaml and renders those in swagger/redoc.

I will submit a PR, then you can test it.

@afuetterer
Copy link
Member Author

Regarding the versioning here:

There is the RDMO version, e.g. 2.1.3 or 2.2.0, and there is a URL path versioning api/v1/.

What is the difference here?

Is the "version" of the API always "v1"?

@jochenklar
Copy link
Member

jochenklar commented Jul 12, 2024

Yes, the version is always v1, and its there in case we have another one and need to run them both in parallel. A lot of people say that it is super important to version apis in this way, so I try to do it all the time. An I needed it once.

@afuetterer
Copy link
Member Author

$ python manage.py spectacular --color --file schema.yml --validate
[...]
Schema generation summary:
Warnings: 237 (109 unique)
Errors:   28 (5 unique)

@afuetterer
Copy link
Member Author

afuetterer commented Jul 13, 2024

This is the swagger schema generated by django-rest-swagger: https://github.com/afuetterer/rdmo/blob/698-drf-spectacular/django-rest-swagger.yaml

npx open-swagger-ui --open django-rest-swagger.yaml

@afuetterer
Copy link
Member Author

What about this repo?

https://github.com/rdmorganiser/rdmo-openapi

@afuetterer afuetterer changed the title Replace django-rest-swagger Replace django-rest-swagger with drf-spectacular Jul 15, 2024
@jochenklar
Copy link
Member

I think https://github.com/rdmorganiser/rdmo-openapi was used by @triole a long time ago. If I understood correctly, we need to include the schema into the rdmo repos anyway if we want to use drf-spectacular, right?

@afuetterer
Copy link
Member Author

Can we please archive https://github.com/rdmorganiser/rdmo-openapi then and add a reference, that this is out of date?

@afuetterer
Copy link
Member Author

The schema is auto generated by drf-spectacular when the URL of the schema browser is accessed. I thought it could be inserted, but that does not seem to be possible.

@jochenklar
Copy link
Member

Ok so it is like with swagger before, fine for me.

@afuetterer
Copy link
Member Author

It spits out a billion warnings though. Mostly about typing. But to be honest I am not in the mood to fix those. Let me open and rebase the PR again and you can look at it.

django rest swagger is deprecated and should go in my opinion.

Is the swagger view used a lot? Maybe this could be optional, in case an instance will not use it?

Anyway this stops us from supporting Python 3.13, which is bad.

@MyPyDavid
Copy link
Member

MyPyDavid commented Feb 20, 2025

thanks @afuetterer for setting this up, I checked it out with the spectacular command and collected the warnings here.
I think we need add some of those @extend_schema_field and @extend_schema to our serializers to fix them. I could definitively look into this as well and would like to keep the swagger UI in the end.

We could first make this upgrade to drf-spectacular and the OpenAPI 3.0.3 (the default version?) schema and afterwards enable the Swagger UI independently right?

WARNINGS:
/rdmo/conditions/serializers/v1.py:13:, [ConditionViewSet > ConditionSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/conditions/viewsets.py:20:, [ConditionViewSet]: could not derive type of path parameter "var" because model "rdmo.conditions.models.Condition" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/core/serializers.py:23:, [RelationViewSet > ChoicesSerializer]: unable to resolve type hint for function "get_id". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/core/serializers.py:23:, [RelationViewSet > ChoicesSerializer]: unable to resolve type hint for function "get_text". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/core/serializers.py:252:, [GroupViewSet > GroupSerializer]: Encountered 2 components with identical names "Group" and different classes <class 'rdmo.core.serializers.GroupSerializer'> and <class 'rdmo.accounts.serializers.v1.GroupSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
/rdmo/core/viewsets.py:17: Error [SettingsViewSet]: exception raised while getting serializer. Hint: Is get_serializer_class() returning None or is get_queryset() not working without a request? Ignoring the view for now. (Exception: 'SettingsViewSet' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method.)
/rdmo/core/serializers.py:235:, [SitesViewSet > SiteSerializer]: Encountered 2 components with identical names "Site" and different classes <class 'rdmo.core.serializers.SiteSerializer'> and <class 'rdmo.accounts.serializers.v1.SiteSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
/rdmo/core/viewsets.py:39: Error [TemplatesViewSet]: exception raised while getting serializer. Hint: Is get_serializer_class() returning None or is get_queryset() not working without a request? Ignoring the view for now. (Exception: 'TemplatesViewSet' should either include a `serializer_class` attribute, or override the `get_serializer_class()` method.)
/rdmo/domain/serializers/v1.py:77:, [AttributeViewSet > AttributeListSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/domain/serializers/v1.py:77:, [AttributeViewSet > AttributeListSerializer]: unable to resolve type hint for function "is_leaf_node". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/domain/serializers/v1.py:37:, [AttributeViewSet > AttributeSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/domain/serializers/v1.py:37:, [AttributeViewSet > AttributeSerializer]: unable to resolve type hint for function "get_tasks". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/domain/serializers/v1.py:37:, [AttributeViewSet > AttributeSerializer]: unable to resolve type hint for function "get_attributes". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/domain/viewsets.py:25:, [AttributeViewSet]: could not derive type of path parameter "var" because model "rdmo.domain.models.Attribute" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/management/viewsets.py:67: Error [ImportViewSet]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/rdmo/management/viewsets.py:24: Error [MetaViewSet]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/rdmo/management/viewsets.py:32: Error [UploadViewSet]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/rdmo/options/serializers/v1/option.py:16:, [OptionViewSet > OptionSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/serializers/v1/option.py:16:, [OptionViewSet > OptionSerializer]: unable to resolve type hint for function "text". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/serializers/v1/option.py:16:, [OptionViewSet > OptionSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/serializers/v1/option.py:16:, [OptionViewSet > OptionSerializer]: unable to resolve type hint for function "view_text". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/serializers/v1/option.py:16:, [OptionViewSet > OptionSerializer]: unable to resolve type hint for function "label". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/serializers/v1/option.py:16:, [OptionViewSet > OptionSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/viewsets.py:93:, [OptionViewSet]: could not derive type of path parameter "var" because model "rdmo.options.models.Option" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/options/serializers/v1/optionset.py:25:, [OptionSetViewSet > OptionSetSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/serializers/v1/optionset.py:25:, [OptionSetViewSet > OptionSetSerializer]: unable to resolve type hint for function "get_condition_uris". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/options/viewsets.py:29:, [OptionSetViewSet]: could not derive type of path parameter "var" because model "rdmo.options.models.OptionSet" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/overlays/viewsets.py:13: Error [OverlayViewSet]: unable to guess serializer. This is graceful fallback handling for APIViews. Consider using GenericAPIView as view base class, if view is under your control. Either way you may want to add a serializer_class (or method). Ignoring view for now.
/rdmo/projects/serializers/v1/overview.py:9:, [CatalogViewSet > CatalogSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/viewsets.py:756:, [MembershipViewSet]: Failed to obtain model through view's queryset due to raised exception. Prevent this either by setting "queryset = Model.objects.none()" on the view, checking for "getattr(self, "swagger_fake_view", False)" in get_queryset() or by simply using @extend_schema. (Exception: 'MembershipQuerySet' object has no attribute 'objects')
/rdmo/projects/serializers/v1/__init__.py:319:, [MembershipViewSet > MembershipSerializer]: Encountered 2 components with identical names "Membership" and different classes <class 'rdmo.projects.serializers.v1.MembershipSerializer'> and <class 'rdmo.accounts.serializers.v1.MembershipSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
/rdmo/projects/viewsets.py:756:, [MembershipViewSet]: could not derive type of path parameter "id" because it is untyped and obtaining queryset from the viewset failed. Consider adding a type to the path (e.g. <int:id>) or annotating the parameter type with @extend_schema. Defaulting to "string".
/rdmo/projects/serializers/v1/__init__.py:44:, [ProjectViewSet > ProjectSerializer]: unable to resolve type hint for function "catalog_uri". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:28:, [ProjectViewSet > ProjectSerializer > UserSerializer]: Encountered 2 components with identical names "User" and different classes <class 'rdmo.projects.serializers.v1.UserSerializer'> and <class 'rdmo.accounts.serializers.v1.UserSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
/rdmo/projects/viewsets.py:435:, [ProjectIntegrationViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.projects.models.integration.Integration" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/viewsets.py:452:, [ProjectInviteViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.projects.models.invite.Invite" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/viewsets.py:482:, [ProjectIssueViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.projects.models.issue.Issue" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/viewsets.py:411:, [ProjectMembershipViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.projects.models.membership.Membership" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/viewsets.py:677:, [ProjectPageViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.questions.models.page.Page" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "get_verbose_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "get_elements". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "get_section". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "get_prev_page". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "get_next_page". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/page.py:153:, [ProjectPageViewSet > PageSerializer]: unable to resolve type hint for function "has_conditions". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/viewsets.py:502:, [ProjectSnapshotViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.projects.models.snapshot.Snapshot" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/viewsets.py:515:, [ProjectValueViewSet]: could not derive type of path parameter "parent_lookup_project" because model "rdmo.projects.models.value.Value" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/serializers/v1/__init__.py:289:, [ProjectValueViewSet > ProjectValueSerializer]: unable to resolve type hint for function "attribute_uri". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:289:, [ProjectValueViewSet > ProjectValueSerializer]: unable to resolve type hint for function "option_uri". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:289:, [ProjectValueViewSet > ProjectValueSerializer]: unable to resolve type hint for function "file_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:289:, [ProjectValueViewSet > ProjectValueSerializer]: unable to resolve type hint for function "file_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/viewsets.py:98:, [ProjectViewSet]: could not derive type of path parameter "var" because model "rdmo.projects.models.project.Project" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/projects/serializers/v1/__init__.py:416:, [ValueViewSet > ValueSerializer]: unable to resolve type hint for function "attribute_uri". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:416:, [ValueViewSet > ValueSerializer]: unable to resolve type hint for function "option_uri". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:416:, [ValueViewSet > ValueSerializer]: unable to resolve type hint for function "file_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/projects/serializers/v1/__init__.py:416:, [ValueViewSet > ValueSerializer]: unable to resolve type hint for function "file_url". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/catalog.py:27:, [CatalogViewSet > CatalogSerializer]: Encountered 2 components with identical names "Catalog" and different classes <class 'rdmo.questions.serializers.v1.catalog.CatalogSerializer'> and <class 'rdmo.projects.serializers.v1.overview.CatalogSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
/rdmo/questions/serializers/v1/catalog.py:27:, [CatalogViewSet > CatalogSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/catalog.py:27:, [CatalogViewSet > CatalogSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/catalog.py:27:, [CatalogViewSet > CatalogSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/catalog.py:27:, [CatalogViewSet > CatalogSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/viewsets.py:46:, [CatalogViewSet]: could not derive type of path parameter "var" because model "rdmo.questions.models.catalog.Catalog" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: Encountered 2 components with identical names "Page" and different classes <class 'rdmo.questions.serializers.v1.page.PageSerializer'> and <class 'rdmo.projects.serializers.v1.page.PageSerializer'>. This will very likely result in an incorrect schema. Try renaming one.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "short_title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "verbose_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/page.py:38:, [PageViewSet > PageSerializer]: unable to resolve type hint for function "get_condition_uris". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/viewsets.py:194:, [PageViewSet]: could not derive type of path parameter "var" because model "rdmo.questions.models.page.Page" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "text". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "default_text". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "verbose_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "get_condition_uris". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/question.py:19:, [QuestionViewSet > QuestionSerializer]: unable to resolve type hint for function "get_optionset_uris". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/viewsets.py:355:, [QuestionViewSet]: could not derive type of path parameter "var" because model "rdmo.questions.models.question.Question" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/questions/serializers/v1/questionset.py:37:, [QuestionSetViewSet > QuestionSetSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/questionset.py:37:, [QuestionSetViewSet > QuestionSetSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/questionset.py:37:, [QuestionSetViewSet > QuestionSetSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/questionset.py:37:, [QuestionSetViewSet > QuestionSetSerializer]: unable to resolve type hint for function "verbose_name". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/questionset.py:37:, [QuestionSetViewSet > QuestionSetSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/questionset.py:37:, [QuestionSetViewSet > QuestionSetSerializer]: unable to resolve type hint for function "get_condition_uris". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/viewsets.py:274:, [QuestionSetViewSet]: could not derive type of path parameter "var" because model "rdmo.questions.models.questionset.QuestionSet" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/questions/serializers/v1/section.py:27:, [SectionViewSet > SectionSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/section.py:27:, [SectionViewSet > SectionSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/section.py:27:, [SectionViewSet > SectionSerializer]: unable to resolve type hint for function "short_title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/serializers/v1/section.py:27:, [SectionViewSet > SectionSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/questions/viewsets.py:121:, [SectionViewSet]: could not derive type of path parameter "var" because model "rdmo.questions.models.section.Section" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/tasks/serializers/v1.py:15:, [TaskViewSet > TaskSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/tasks/serializers/v1.py:15:, [TaskViewSet > TaskSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/tasks/serializers/v1.py:15:, [TaskViewSet > TaskSerializer]: unable to resolve type hint for function "text". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/tasks/serializers/v1.py:15:, [TaskViewSet > TaskSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/tasks/serializers/v1.py:15:, [TaskViewSet > TaskSerializer]: unable to resolve type hint for function "get_condition_uris". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/tasks/viewsets.py:21:, [TaskViewSet]: could not derive type of path parameter "var" because model "rdmo.tasks.models.Task" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
/rdmo/views/serializers/v1.py:17:, [ViewViewSet > ViewSerializer]: unable to resolve type hint for function "get_model". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/views/serializers/v1.py:17:, [ViewViewSet > ViewSerializer]: unable to resolve type hint for function "title". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/views/serializers/v1.py:17:, [ViewViewSet > ViewSerializer]: unable to resolve type hint for function "help". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/views/serializers/v1.py:17:, [ViewViewSet > ViewSerializer]: unable to resolve type hint for function "get_warning". Consider using a type hint or @extend_schema_field. Defaulting to string.
/rdmo/views/viewsets.py:21:, [ViewViewSet]: could not derive type of path parameter "var" because model "rdmo.views.models.View" contained no such field. Consider annotating parameter with @extend_schema. Defaulting to "string".
Warning: operationId "conditions_conditions_export_retrieve" has collisions [('/api/v1/conditions/conditions/{id}/export{var}/', 'get'), ('/api/v1/conditions/conditions/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "domain_attributes_export_retrieve" has collisions [('/api/v1/domain/attributes/{id}/export{var}/', 'get'), ('/api/v1/domain/attributes/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "options_options_export_retrieve" has collisions [('/api/v1/options/options/{id}/export{var}/', 'get'), ('/api/v1/options/options/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "options_optionsets_export_retrieve" has collisions [('/api/v1/options/optionsets/{id}/export{var}/', 'get'), ('/api/v1/options/optionsets/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "questions_catalogs_export_retrieve" has collisions [('/api/v1/questions/catalogs/{id}/export{var}/', 'get'), ('/api/v1/questions/catalogs/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "questions_pages_export_retrieve" has collisions [('/api/v1/questions/pages/{id}/export{var}/', 'get'), ('/api/v1/questions/pages/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "questions_questions_export_retrieve" has collisions [('/api/v1/questions/questions/{id}/export{var}/', 'get'), ('/api/v1/questions/questions/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "questions_questionsets_export_retrieve" has collisions [('/api/v1/questions/questionsets/{id}/export{var}/', 'get'), ('/api/v1/questions/questionsets/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "questions_sections_export_retrieve" has collisions [('/api/v1/questions/sections/{id}/export{var}/', 'get'), ('/api/v1/questions/sections/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "tasks_tasks_export_retrieve" has collisions [('/api/v1/tasks/tasks/{id}/export{var}/', 'get'), ('/api/v1/tasks/tasks/export{var}/', 'get')]. resolving with numeral suffixes.
Warning: operationId "views_views_export_retrieve" has collisions [('/api/v1/views/views/{id}/export{var}/', 'get'), ('/api/v1/views/views/export{var}/', 'get')]. resolving with numeral suffixes.

Schema generation summary:
Warnings: 240 (111 unique)
Errors:   32 (6 unique)

@afuetterer
Copy link
Member Author

Feel free to take over. I just wanted to give an up to date alternative to django rest swagger.

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

Successfully merging a pull request may close this issue.

3 participants