Project

Profile

Help

Issue #3351

closed

The parameters in the api schema for the sync and publish endpoints are incorrect

Added by daviddavis almost 7 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
1. Low
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 34
Quarter:

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

Blocked by Pulp - Issue #3420: Not able to access documentation endpointCLOSED - CURRENTRELEASEmilanActions
Actions #1

Updated by daviddavis almost 7 years ago

  • Tags Pulp 3, Pulp 3 MVP added
Actions #2

Updated by jortel@redhat.com almost 7 years ago

  • Sprint/Milestone set to 54
  • Triaged changed from No to Yes
Actions #3

Updated by daviddavis almost 7 years ago

  • Severity changed from 2. Medium to 1. Low
Actions #4

Updated by jortel@redhat.com almost 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com
Actions #5

Updated by daviddavis almost 7 years ago

I think this issue may be fixed by https://github.com/pulp/pulp/pull/3234

Actions #6

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

Revision 71910e8f | View on GitHub

Define schema for detail routes. closes #3351

Actions #7

Updated by rchan almost 7 years ago

  • Sprint/Milestone changed from 54 to 56
Actions #8

Updated by jortel@redhat.com almost 7 years ago

  • Status changed from ASSIGNED to POST
Actions #9

Updated by jortel@redhat.com almost 7 years ago

  • Status changed from POST to MODIFIED
Actions #10

Updated by daviddavis almost 7 years ago

  • Status changed from MODIFIED to NEW
Actions #11

Updated by daviddavis almost 7 years ago

  • Blocked by Issue #3420: Not able to access documentation endpoint added
Actions #12

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.

Actions #13

Updated by bmbouter almost 7 years ago

  • Sprint set to Sprint 33
Actions #14

Updated by bmbouter almost 7 years ago

  • Sprint/Milestone deleted (56)
Actions #15

Updated by jortel@redhat.com almost 7 years ago

  • Sprint changed from Sprint 33 to Sprint 34
Actions #16

Updated by milan almost 7 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

Actions #17

Updated by jortel@redhat.com over 6 years ago

  • Status changed from POST to MODIFIED
Actions #18

Updated by bmbouter over 5 years ago

  • Tags deleted (Pulp 3, Pulp 3 MVP)
Actions #19

Updated by bmbouter about 5 years ago

  • Sprint/Milestone set to 0.1.0
Actions #20

Updated by bmbouter about 5 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF