Project

Profile

Help

Issue #4749

Updated by gmbnomis almost 5 years ago

 

 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@, HyperlinkedRelatedField, i.e. returns a full URI 
 2. The URL is broken  

 Example: 

 <pre><code class="json"> 
 { 
     "_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/" 
 } 
 </code></pre> 

 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). 

Back