Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions answerking/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
)

urlpatterns += [
path("api/schema/", SpectacularAPIView.as_view(), name="schema"),
path("api/schema", SpectacularAPIView.as_view(), name="schema"),
path(
"api/schema/swagger-ui/",
"api/schema/swagger-ui",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed trailing slashes as this was breaking this endpoint

SpectacularSwaggerView.as_view(url_name="schema"),
name="swagger-ui",
),
path(
"api/schema/redoc/",
"api/schema/redoc",
SpectacularRedocView.as_view(url_name="schema"),
name="redoc",
),
Expand Down
1 change: 0 additions & 1 deletion answerking_app/views/category_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
)
from answerking_app.utils.schema.schema_examples import (
category_example,
retired_category_example,
category_body_example,
problem_detail_example,
category_products_body_example,
Expand Down
4 changes: 2 additions & 2 deletions answerking_app/views/product_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
product_body_example,
product_categories_body_example,
product_example,
retired_product_example,
)
from answerking_app.utils.url_parameter_check import check_url_parameter

Expand Down Expand Up @@ -92,8 +91,9 @@ def post(self, request: Request, *args, **kwargs) -> Response:

class ProductDetailView(
RetireMixin,
generics.UpdateAPIView,
mixins.UpdateModelMixin,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed because generics.UpdateAPIView was also creating a PATCH endpoint in the swagger-UI contract

mixins.RetrieveModelMixin,
generics.GenericAPIView,
):
queryset: QuerySet = Product.objects.all()
serializer_class: ProductSerializer = ProductSerializer
Expand Down
4 changes: 2 additions & 2 deletions answerking_app/views/tag_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from answerking_app.utils.mixins.RetireMixin import RetireMixin
from answerking_app.utils.schema.schema_examples import (
problem_detail_example,
retired_tag_example,
tag_body_example,
tag_example,
)
Expand Down Expand Up @@ -86,8 +85,9 @@ def post(self, request: Request, *args, **kwargs) -> Response:

class TagDetailView(
RetireMixin,
generics.UpdateAPIView,
mixins.UpdateModelMixin,
mixins.RetrieveModelMixin,
generics.GenericAPIView,
):
queryset: QuerySet = Tag.objects.all()
serializer_class: TagSerializer = TagSerializer
Expand Down