Skip to content

Commit

Permalink
views: FAIR signposting remove linkset link to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
ptamarit committed Dec 13, 2024
1 parent 7e17fad commit 34eac5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def serialize_describedby(self, obj, **kwargs):
result = [
{"href": obj["links"]["self"], "type": mimetype}
for mimetype in sorted(record_serializers)
# Remove the linkset serializer, so that the linkset does not link to itself.
if mimetype != "application/linkset+json"
]

return result or missing
Expand Down
16 changes: 8 additions & 8 deletions tests/resources/serializers/test_signposting_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ def test_signposting_serializer_full(running_app, full_record_to_dict):
"href": "https://127.0.0.1:5000/api/records/12345-abcde",
"type": "application/ld+json",
},
{
"href": "https://127.0.0.1:5000/api/records/12345-abcde",
"type": "application/linkset+json",
},
# {
# "href": "https://127.0.0.1:5000/api/records/12345-abcde",
# "type": "application/linkset+json",
# },
{
"href": "https://127.0.0.1:5000/api/records/12345-abcde",
"type": "application/marcxml+xml",
Expand Down Expand Up @@ -146,10 +146,10 @@ def test_signposting_serializer_minimal(running_app, minimal_record_to_dict):
"href": "https://127.0.0.1:5000/api/records/67890-fghij",
"type": "application/ld+json",
},
{
"href": "https://127.0.0.1:5000/api/records/67890-fghij",
"type": "application/linkset+json",
},
# {
# "href": "https://127.0.0.1:5000/api/records/67890-fghij",
# "type": "application/linkset+json",
# },
{
"href": "https://127.0.0.1:5000/api/records/67890-fghij",
"type": "application/marcxml+xml",
Expand Down

0 comments on commit 34eac5e

Please sign in to comment.