Skip to content

Commit af97177

Browse files
committed
views: FAIR signposting remove linkset link to itself
1 parent 28392a7 commit af97177

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

invenio_rdm_records/resources/serializers/signposting/schema.py

+2
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def serialize_describedby(self, obj, **kwargs):
7575
result = [
7676
{"href": obj["links"]["self"], "type": mimetype}
7777
for mimetype in sorted(record_serializers)
78+
# Remove the linkset serializer, so that the linkset does not link to itself.
79+
if mimetype != "application/linkset+json"
7880
]
7981

8082
return result or missing

tests/resources/serializers/test_signposting_serializer.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def test_signposting_serializer_full(running_app, full_record_to_dict):
3333
"href": "https://127.0.0.1:5000/api/records/12345-abcde",
3434
"type": "application/ld+json",
3535
},
36-
{
37-
"href": "https://127.0.0.1:5000/api/records/12345-abcde",
38-
"type": "application/linkset+json",
39-
},
36+
# {
37+
# "href": "https://127.0.0.1:5000/api/records/12345-abcde",
38+
# "type": "application/linkset+json",
39+
# },
4040
{
4141
"href": "https://127.0.0.1:5000/api/records/12345-abcde",
4242
"type": "application/marcxml+xml",
@@ -146,10 +146,10 @@ def test_signposting_serializer_minimal(running_app, minimal_record_to_dict):
146146
"href": "https://127.0.0.1:5000/api/records/67890-fghij",
147147
"type": "application/ld+json",
148148
},
149-
{
150-
"href": "https://127.0.0.1:5000/api/records/67890-fghij",
151-
"type": "application/linkset+json",
152-
},
149+
# {
150+
# "href": "https://127.0.0.1:5000/api/records/67890-fghij",
151+
# "type": "application/linkset+json",
152+
# },
153153
{
154154
"href": "https://127.0.0.1:5000/api/records/67890-fghij",
155155
"type": "application/marcxml+xml",

0 commit comments

Comments
 (0)