Issue #3351
closedThe parameters in the api schema for the sync and publish endpoints are incorrect
Description
The sync and publish endpoints are using the FileImporterSerializer and FilePublisherSerializer as their serializers (respectively). The problem is that this adds all the fields from Importer and Publisher to the docs for these endpoints—fields like name, etc.
Related issues
Updated by jortel@redhat.com almost 7 years ago
- Sprint/Milestone set to 54
- Triaged changed from No to Yes
Updated by daviddavis almost 7 years ago
- Severity changed from 2. Medium to 1. Low
Updated by jortel@redhat.com almost 7 years ago
- Status changed from NEW to ASSIGNED
- Assignee set to jortel@redhat.com
Updated by daviddavis almost 7 years ago
I think this issue may be fixed by https://github.com/pulp/pulp/pull/3234
Updated by bizhang almost 7 years ago
It looks like for every detail view you need to provide a manualschema. So for pulp_file sync it would look like:
diff --git a/pulp_file/app/viewsets.py b/pulp_file/app/viewsets.py
index 8c66efb..d9d08ec 100644
--- a/pulp_file/app/viewsets.py
+++ b/pulp_file/app/viewsets.py
@@ -10,6 +10,8 @@ from pulpcore.plugin.viewsets import (
OperationPostponedResponse,
PublisherViewSet,
tags)
+from rest_framework.schemas import ManualSchema
+from rest_framework.compat import coreapi, coreschema
from .models import FileContent, FileImporter, FilePublisher
from .serializers import FileContentSerializer, FileImporterSerializer, FilePublisherSerializer
@@ -37,7 +39,17 @@ class FileImporterViewSet(ImporterViewSet):
queryset = FileImporter.objects.all()
serializer_class = FileImporterSerializer
- @detail_route(methods=('post',))
+ @detail_route(methods=('post',),
+ schema=ManualSchema(fields=[
+ coreapi.Field(
+ "repository",
+ required=True,
+ schema=coreschema.String()
+ )
+ ]),
+ )
def sync(self, request, pk):
importer = self.get_object()
repository = self.get_resource(request.data['repository'], Repository)
Added by jortel@redhat.com almost 7 years ago
Updated by jortel@redhat.com almost 7 years ago
- Status changed from ASSIGNED to POST
Updated by jortel@redhat.com almost 7 years ago
- Status changed from POST to MODIFIED
Applied in changeset 71910e8ffada657a52eb8324a4d2f8493aa38f3b.
Updated by daviddavis almost 7 years ago
- Blocked by Issue #3420: Not able to access documentation endpoint added
Updated by daviddavis almost 7 years ago
This was temporarily reverted in https://github.com/pulp/pulp_file/pull/50. We need to redo this work once https://pulp.plan.io/issues/3420 is merged.
Updated by jortel@redhat.com almost 7 years ago
- Sprint changed from Sprint 33 to Sprint 34
Updated by milan over 6 years ago
- Status changed from NEW to POST
- Assignee changed from jortel@redhat.com to milan
Added by jortel@redhat.com over 6 years ago
Revision 413563f3 | View on GitHub
Define schema for detail routes. closes #3351
Updated by jortel@redhat.com over 6 years ago
- Status changed from POST to MODIFIED
Applied in changeset 413563f354fc09ce3a1719ced151e652e6813c21.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Define schema for detail routes. closes #3351