Actions
Issue #4590
closedReturn relative URI for distributions
Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Sprint:
Sprint 52
Quarter:
Description
When listing a publication, notice the full URL for distributions. It should be a relative URI like the rest of resources.
$ http :8000/pulp/api/v3/publications/9ba90d2f-900d-4e3c-a716-452b39d3701d/
HTTP/1.1 200 OK
Allow: GET, DELETE, HEAD, OPTIONS
Connection: close
Content-Length: 405
Content-Type: application/json
Date: Wed, 27 Mar 2019 18:00:52 GMT
Server: gunicorn/19.9.0
Vary: Accept, Cookie
X-Frame-Options: SAMEORIGIN
{
"_created": "2019-03-27T17:14:57.727678Z",
"_distributions": [
"http://localhost:8000/pulp/api/v3/distributions/c63bcc77-c5dc-406a-92ee-b527433516c9/"
],
"_href": "/pulp/api/v3/publications/9ba90d2f-900d-4e3c-a716-452b39d3701d/",
"publisher": "/pulp/api/v3/publishers/rpm/rpm/a275f1b5-d73e-4170-be98-ce338c90b2d5/",
"repository_version": "/pulp/api/v3/repositories/64bdeb44-c6d3-4ed7-9c5a-94b264a6b7b5/versions/1/"
}
Actions
Problem: publication's distributions are full URLs
Solution: use RelatedField instead of HyperlinkedRelatedField
The serializer was using the wrong type of field for serializing the Publication's distrubtions field.
fixes: #4590 https://pulp.plan.io/issues/4590