Conversation
fenekku
left a comment
There was a problem hiding this comment.
Thanks for spotting this! It's indeed the case that profile should be supported as an extension attribute/separate entry. serialize_item would need it too and black wants a different slice syntax : -1. I'll double-check once addressed and should be able to merge this fix in.
| pid_value=obj["id"], | ||
| filename=entry["key"], | ||
| ), | ||
| "type": entry["mimetype"], |
There was a problem hiding this comment.
The above logic for providing a profile extension attribute should also be placed here to be compliant. Probably not often or even typically the case, but it could be actually and the official signposting spec does allow for this too.
| if ";" in mimetype: | ||
| media_type, _, params = mimetype.partition(";") | ||
| entry = {"href": obj["links"]["self"], "type": media_type.strip()} | ||
| params = params.strip() | ||
| if params.startswith('profile="') and params.endswith('"'): | ||
| entry["profile"] = params[len('profile="'):-1] | ||
| else: | ||
| entry = {"href": obj["links"]["self"], "type": mimetype} |
There was a problem hiding this comment.
extract above as method/function for reuse in the serialize_item.
| entry = {"href": obj["links"]["self"], "type": media_type.strip()} | ||
| params = params.strip() | ||
| if params.startswith('profile="') and params.endswith('"'): | ||
| entry["profile"] = params[len('profile="'):-1] |
There was a problem hiding this comment.
Black needs to appeased here 😁
|
Since no activity on this, I will take it over this week. |
❤️ Thank you for your contribution!
Description
As stated in inveniosoftware/invenio-app-rdm#3308, the Link field header entry was malformed when receiving type and profile simultaneously, which is solved in this PR by parsing that value in FAIRSignpostingProfileLvl1Serializer and LandingPageSchema
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: