Hypothesis file preview not possible
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
entrepot.recherche.data.gouv.fr team
What steps does it take to reproduce the issue?
upload a json file to a dataset
- What happens?
The dataverse configuration for a json file is as follows:
it is impossible to obtain a Hypothesis type json file with its corresponding MimeType:
application/x-json-hypothesis
Finally, it is not possible to obtain a preview provided by dataverse-previewers because there is no json file with the correct MimeType:
curl -X POST -H 'Content-type: application/json' http://localhost:8080/api/admin/externalTools -d \
'{
"displayName":"View Annotations",
"description":"View the annotation entries in a file.",
"toolName":"annotationPreviewer",
"scope":"file",
"types":["preview"],
"toolUrl":"https://gdcc.github.io/dataverse-previewers/previewers/v1.3/HypothesisPreview.html",
"toolParameters": {
"queryParameters":[
{"fileid":"{fileId}"},
{"siteUrl":"{siteUrl}"},
{"key":"{apiToken}"},
{"datasetid":"{datasetId}"},
{"datasetversion":"{datasetVersion}"},
{"locale":"{localeCode}"}
]
},
"contentType":"application/x-json-hypothesis"
}'
- To whom does it occur (all users, curators, superusers)?
all users
- What did you expect to happen?
Is this behavior of Dataverse intended or does it correspond to a configuration limitation?
Which version of Dataverse are you using?
5.12.1+
Any related open or closed issues to this bug report?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MIME mapping in src/main/java/propertyFiles/MimeTypeDetectionByFileExtension.properties at the linked line, then reproduce the JSON upload and inspect the externalTools request shown in the report. Compare the detected file type with application/x-json-hypothesis and establish whether the preview limitation is intentional or requires a configuration change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100