Actions
Issue #4683
closedOpenAPI schema for Artifacts create operation is ambiguous
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
No
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Quarter:
Description
The bindings generated from Pulp's OpenAPI schema don't form-encode requests for the 'artifacts_create' operation. This results in a 400 error being returned by the server.
Added by dkliban@redhat.com over 5 years ago
Updated by dkliban@redhat.com over 5 years ago
- Subject changed from OpenAPI schema for Artifacts create operation is ambigous to OpenAPI schema for Artifacts create operation is ambiguous
- Status changed from ASSIGNED to POST
Updated by dkliban@redhat.com over 5 years ago
- Status changed from POST to MODIFIED
Applied in changeset pulpcore|b594bb836f2f22f8c5b63c0962c8cdfa307bd5e1.
Updated by bmbouter almost 5 years ago
- Status changed from MODIFIED to CLOSED - CURRENTRELEASE
Actions
Problem: OpenAPI schema for 'Artifact create' is ambiguous
Solution: Remove JSONParser from ArtifactViewset
The ArtifactViewset viewset was configured to use MultiPartParser, FormParser, and JSONParser. The JSONParser was added when the ArtifactViewset was extended to accept uploads when creating an Artifact. It was only needed to allow users to submit not form-encoded requests to the /pulp/api/v3/artifacts/ endpoint. However, 'drf_yasg' does not support mixing multipart/form-data and json fields. When such occurs, the body parameters for the operation are simply reported as 'data' dictionary. The bindings generated from such an OpenAPI schema don't form-encode requests for the 'artifacts_create' operation. This results in a 400 error being returned by the server.
fixes: #4683 https://pulp.plan.io/issues/4683