IQSS / IQSS/dataverse

Dataset JSON GET API returns numbers as strings

Open
#9,494 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Feature: API Type: Bug User Role: API User
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?

  1. Enable metadata block with fields with fieldType int or float
  2. Create dataset
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.