Skip to content

superskunk: Refactor controller

kibigo! requested to merge superskunk-refactor-controller into trunk

Valkyrie does not care about the type of a resource when fetching by ID, so it doesn’t really make sense to have different endpoints for them. This commit centralizes the API on a single /resources/:id endpoint.

Accept header handling has been extracted to a new AcceptReader service to clean up the controller a bit. The API now attempts a fallback to OAI∕DC if acceptable; we may change this to a different fallback format later once we actually have some others.

OAI∕DC responses should now minimally conform to documentation, although this isn’t yet tested. Errors are now JSON instead of plaintext.

Incorporates changes for #961 (closed); #955 (closed).

Merge request reports