Issue #4749
closed"repository" field on Publication is broken
Description
The repository
field on the PublicationSerializer
see https://github.com/pulp/pulpcore/blob/c6ca9f60c63b85e41b2aab6b6ec909d9bfe1964c/pulpcore/app/serializers/publication.py#L39 has two problems on reading:
1. It uses HyperlinkedRelatedField
, i.e. returns a full URI
2. The URL is broken
Example:
{
"_created": "2019-04-30T21:27:42.622727Z",
"_distributions": [],
"_href": "/pulp/api/v3/publications/cookbook/cookbook/61e0a809-635b-48e6-a953-6b237e8d5dab/",
"_type": "cookbook.cookbook",
"publisher": "/pulp/api/v3/publishers/cookbook/cookbook/a5abd1d9-de46-4b7c-bdc8-3a3157237638/",
"repository": "http://localhost:24817/pulp/api/v3/repositories/%3CRepository:%20foo%3E/",
"repository_version": "/pulp/api/v3/repositories/8d8a93da-1cee-4edb-83f8-896591809093/versions/1/"
}
Additionally, we may consider to make this field write only: When reading, it may be confusing (a publication is always based on the repository version only. "repository" is a parameter that may be given for convenience when creating a publication).
Related issues
Updated by kersom over 5 years ago
- Related to Test #4874: Test create a Publication using a Repository Version added
Updated by kersom over 5 years ago
- Related to Issue #4792: Serialization bug on Publications added
Updated by dalley over 5 years ago
- Related to deleted (Issue #4792: Serialization bug on Publications)
Updated by dalley over 5 years ago
- Has duplicate Issue #4792: Serialization bug on Publications added
Updated by dalley over 5 years ago
- Status changed from NEW to CLOSED - DUPLICATE
I ran across this separately and didn't see this issue, so I filed a new one and linked it in my commit message. The underlying issue will be fixed with https://github.com/pulp/pulpcore/pull/152