Project

Profile

Help

Issue #5016

closed

Artifact creation endpoint should accept json requests

Added by daviddavis almost 5 years ago. Updated over 4 years ago.

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

There are two ways to create an artifact: from a file and from a chunked upload. The chunked upload request takes an upload id. However, it looks like it doesn't work when using json:

$ http POST :24817/pulp/api/v3/artifacts/ upload=$UPLOAD

{
    "detail": "Unsupported media type \"application/json\" in request."
}
Actions #1

Updated by daviddavis almost 5 years ago

I fixed the problem by adding JSONParser to the list of parser_classes for the Artifact viewset but now the docs are wrong in that they show only json is accepted (and not multipart form as well).

Actions #2

Updated by daviddavis almost 5 years ago

  • Status changed from NEW to CLOSED - WONTFIX

This is affected by a bug in yasg. See https://github.com/axnsan12/drf-yasg/issues/386. I don't think it's worth implementing a workaround so I am closing this out.

Actions #3

Updated by daviddavis almost 5 years ago

  • Status changed from CLOSED - WONTFIX to POST

Added by daviddavis almost 5 years ago

Revision 01c67625 | View on GitHub

Allow json to be used to create artifacts from upload

I confirmed that the REST API docs display 'multipart/form-data'.

fixes #5016 https://pulp.plan.io/issues/5016

Actions #4

Updated by daviddavis almost 5 years ago

  • Status changed from POST to MODIFIED
Actions #5

Updated by bmbouter over 4 years ago

  • Sprint/Milestone set to 3.0.0
Actions #6

Updated by bmbouter over 4 years ago

  • Status changed from MODIFIED to CLOSED - CURRENTRELEASE

Also available in: Atom PDF