Page MenuHomeSoftware Heritage

Web API: make /origin/ return the swh:1:ori:... PID
Closed, WontfixPublic

Description

it currently return something like this:

{
    "id": 1,
    "origin_visits_url": "/api/1/origin/https://github.com/hylang/hy/visits/",
    "type": "git",
    "url": "https://github.com/hylang/hy"
}

I propose to extend it like this:

{
    "id": 1,
    "ori_id": "swh:1:ori:7bed762bf5ddc7164a08dac613ead782784474bb",
    "origin_visits_url": "/api/1/origin/https://github.com/hylang/hy/visits/",
    "type": "git",
    "url": "https://github.com/hylang/hy"
}

The id v. ori_id isn't great, but it seems we are already inconsistent in how we call the ID field in other methods (e.g., revision uses id while directory uses dir_id (for subdirs)). ori_id seems the best way out of this.

@vlorentz: can you note down as additional TODO item for API v2 to consistently use pid as field name for, well, PIDs?

Event Timeline

zack triaged this task as Low priority.Aug 26 2019, 4:01 PM
zack created this task.
zack added a project: Web app.
zack closed this task as Wontfix.Nov 20 2019, 12:48 PM
zack claimed this task.