Dataset JSON GET API returns numbers as strings
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 564
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 29
Description
What steps does it take to reproduce the issue?
- Enable metadata block with fields with
fieldTypeintorfloat - Create dataset
- Use the JSON GET API to retrieve the dataset https://guides.dataverse.org/en/latest/api/native-api.html#get-json-representation-of-a-dataset e.g.
GET /api/datasets/42?exporter=dataverse_json
- What happens?
The values for the numerical fields are returned as strings, e.g. {'typeName': 'my_int_field', 'multiple': False, 'typeClass': 'primitive', 'value': '5'}
- What did you expect to happen?
The numerical fields to be returned as integers/floats, e.g. {'typeName': 'my_int_field', 'multiple': False, 'typeClass': 'primitive', 'value': 5}
Which version of Dataverse are you using?
v5.13
Any related open or closed issues to this bug report?
/
Screenshots:
/
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 dataset JSON GET endpoint documented in the issue and trace the dataverse_json exporter. Reproduce the response using int and float metadata fields, then inspect the serialization path for where values become strings. Done means the GET response returns JSON numbers for both types, with regression coverage for the behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100