Is there a way to update a software catalog entry for a given version?


#1

The Software Catalog upload interface has name + version as PK and doesn’t update when I POST a updated entry.

Thanks in advance.


#2

To update software version in the catalog you can send PATCH or PUT request to the API
For example:

curl -v -H Authorization:“Bearer token” -H Content-Type:“application/json” -X PATCH -d ‘json’ https://services.humanbrainproject.eu/software-catalog/v0/api/software/<software_name>/version//

Where json is json string with fields you would like to update

{“documentation”: “https://aaa.bbb”}


#3

According to the Allow header of the response, the service Accepts POST and OPTIONS only
Consequently the result is 405 with {“detail”:“Method “PUT” not allowed.”} or {“detail”:“Method “PATCH” not allowed.”} as response body.

While there is a CORS header (Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS), that does not extend what Allow, well, allows.


#4

Which endpoint you are using? My link from previous post was formatted in the wrong way by forum it should be like this:

https://services.humanbrainproject.eu/software-catalog/v0/api/software/<name>/version/<version>/

#5

Thank you for the fast reply, I was about to delete the comment: I forgot putting the name of the software into the url.


#6

I do not know if it is documented anywhere, but “maintainers” and “contributors” feel interconnected: if I set one of them with a PATCH, the other one becomes empty. So I have to set both of them in one step in order to get the proper result.

And a more related one (to the general topic of updating): is it hardcoded that these fields (maintainers and contributors) list entries in “id” order?


#7

As a follow-up, the issue has been solved. The entries were not interconnected but the email address was used as primary key so that you can basically associate only one person to an email. As it seems many projects wanted to use department under the same email address, we have removed this constraint.

For now, the contributors and maintainers are listed by id, true. We might add ordering at some point, it would be useful.