Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating record results in error about wrong PID given #243

Open
nicolasblumenroehr opened this issue Dec 2, 2024 · 2 comments
Open

Updating record results in error about wrong PID given #243

nicolasblumenroehr opened this issue Dec 2, 2024 · 2 comments
Labels
bug Something isn't working confirmation pending A developer needs to reproduce this issue.

Comments

@nicolasblumenroehr
Copy link
Contributor

nicolasblumenroehr commented Dec 2, 2024

With the latest version, updating a Handle Record like 21.11152/474a4b1c-de93-4d4a-b33d-1d32d63baf4b which contains the "URL" attribute for redirecting cannot be updated.

This is the error message:

Response: {"type":"about:blank","title":"Bad Request","status":400,"detail":"Validation of record 21.11152/474a4b1c-de93-4d4a-b33d-1d32d63baf4b failed. Reason:\nPID in record was given, but it was not the same as the PID in the URL. Ignore request, assuming this was not intended.","instance":"/api/v1/pit/pid/"}

This is the request URL:

http://localhost:8082/api/v1/pit/pid/?dryrun=false

This is the corresponding JSON record:

{
"pid": "21.11152/474a4b1c-de93-4d4a-b33d-1d32d63baf4b",
"entries": {
"21.T11148/076759916209e5d62bd5": [
{
"key": "21.T11148/076759916209e5d62bd5",
"name": "kernelInformationProfile",
"value": "21.T11148/b9b76f887845e32d29f7"
}
],
"21.T11148/397d831aa3a9d18eb52c": [
{
"key": "21.T11148/397d831aa3a9d18eb52c",
"name": "dateModified",
"value": "2024-10-14T07:16:46+00:00"
}
],
"21.T11148/82e2503c49209e987740": [
{
"key": "21.T11148/82e2503c49209e987740",
"name": "checksum",
"value": "{ "sha256sum": "a92ad3bd2b0856b70d3f98cb2fa21964ea7f91218c46e327b65a0937c50a885c" }"
}
],
"21.T11148/aafd5fb4c7222e2d950a": [
{
"key": "21.T11148/aafd5fb4c7222e2d950a",
"name": "dateCreated",
"value": "2024-10-14T07:16:46+00:00"
}
],
"21.T11148/b8457812905b83046284": [
{
"key": "21.T11148/b8457812905b83046284",
"name": "digitalObjectLocation",
"value": "https://paint-database.org/WRI1030197/WRI1030197-catalog-stac.json"
}
],
"21.T11148/1a73af9e7ae00182733b": [
{
"key": "21.T11148/1a73af9e7ae00182733b",
"name": "contact",
"value": "https://orcid.org/0009-0007-0235-4995"
},
{
"key": "21.T11148/1a73af9e7ae00182733b",
"name": "contact",
"value": "https://orcid.org/0000-0002-2233-1041"
},
{
"key": "21.T11148/1a73af9e7ae00182733b",
"name": "contact",
"value": "https://orcid.org/0000-0001-9648-4385"
},
{
"key": "21.T11148/1a73af9e7ae00182733b",
"name": "contact",
"value": "https://orcid.org/0000-0002-9197-1739"
},
{
"key": "21.T11148/1a73af9e7ae00182733b",
"name": "contact",
"value": "https://orcid.org/0000-0002-4705-6285"
}
],
"21.T11148/2f314c8fe5fb6a0063a8": [
{
"key": "21.T11148/2f314c8fe5fb6a0063a8",
"name": "licenseURL",
"value": "https://cdla.dev/permissive-2-0/"
}
],
"21.T11148/c83481d4bf467110e7c9": [
{
"key": "21.T11148/1c699a5d1b4ad3ba4956",
"name": "digitalResourceType",
"value": "application/json"
}
]
}
}

@Pfeil
Copy link
Member

Pfeil commented Dec 4, 2024

The url http://localhost:8082/api/v1/pit/pid/?dryrun=false is not correct, should be http://localhost:8082/api/v1/pit/pid/21.11152/474a4b1c-de93-4d4a-b33d-1d32d63baf4b?dryrun=false.

Unfortunately, the openApi/swagger documentation has issues displaying this properly. If this fixes your issue, I will create a new one to see at some point how this can be improved.

For documentation: This is the url swagger exposes: /api/v1/pit/pid/** (see at the docs on our website)

@Pfeil Pfeil changed the title Updating records that contain a "URL" attribute Updating record results in error about wrong PID given Dec 4, 2024
@Pfeil Pfeil added documentation Improvements or additions to documentation question Further information is requested bug Something isn't working confirmation pending A developer needs to reproduce this issue. and removed documentation Improvements or additions to documentation question Further information is requested labels Dec 4, 2024
@Pfeil
Copy link
Member

Pfeil commented Dec 11, 2024

I was notified that the URL was actually the one it should be, so I will try to reproduce this issue and report about the results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working confirmation pending A developer needs to reproduce this issue.
Projects
None yet
Development

No branches or pull requests

2 participants