Actions
Issue #1490
closedErrata IDs not showing up correctly in the API
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
Master
Platform Release:
2.8.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:
Description
When I run the equivalent of following in 2.6
RestClient.post "https://katello-pulp-nightly.example.com/pulp/api/v2/content/units/erratum/search/", "{\"criteria\":{}}", "Accept"=>"*/*; q=0.5, application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"15", "accept"=>"application/json", "content_type"=>"application/json"
I get a list of errata back with each errata row having the following keys
["_href", "issued", "references", "_content_type_id", "id", "from", "severity", "title", "children", "version", "reboot_suggested", "type", "pkglist", "status", "updated", "description", "_last_updated", "pushcount", "_storage_path", "rights", "solution", "summary", "release", "_id"]
However in 2.8 the same call returns errata with each row having the keys of
["_href", "issued", "references", "pulp_user_metadata", "_content_type_id", "children", "from", "severity", "title", "version", "reboot_suggested", "type", "pkglist", "status", "updated", "errata_id", "description", "_last_updated", "pushcount", "downloaded", "_storage_path", "rights", "solution", "summary", "release", "_id"]
This breaks api compatibility for existing users and needs to be fixed.
Related issues
Actions
content unit search views use content unit serializers
Recent changes in the pymongo > mongoengine conversion have resulted in different ways to represent mongo documents in the REST api views; the correct way is to use the mongoengine Document serializers wherever possible. When that isn't possible, remap_fields_with_serializer exists to use the information in a mongoengine serializer to modify serialized results properly.
Anything that is using the serialization functions in pulp.server.webservices.views.serializers.content should automaticaly benefit from this change, which implicitly fixes redmine #1490.
These changes can also be used to benefit views that don't call the existing serialization functions by explicitly using the new remap_fields_with_serializer function as-needed, such as RepoUnitSearch, which will help (but not fix) redmine #1478.
fixes #1490 https://pulp.plan.io/issues/1490
re #1478 https://pulp.plan.io/issues/1478