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

Fix data type of filtered /data JSON response #2256

Merged
merged 3 commits into from
Jun 10, 2022
Merged

Conversation

ukanga
Copy link
Member

@ukanga ukanga commented Jun 9, 2022

Changes / Features implemented

Using the json.loads() to return field values as default type. Django switched from this approach here.

Steps taken to verify this change does what is intended

GET /api/v1/data/{form pk}.json?fields=["_id", "_xform_id_string"]
[{"_id": 1, "__xform_id_string": "id_string"}, {"_id": 2, "__xform_id_string": "id_string"}, ..]

instead of

GET /api/v1/data/{form pk}.json?fields=["_id", "_xform_id_string"]
[{"_id": "1", "__xform_id_string": "\"id_string\""}, {"_id": "2", "__xform_id_string": "\"id_string\""}, ..]

Side effects of implementing this change

Before submitting this PR for review, please make sure you have:

  • Included tests
  • Updated documentation - n/a

Closes #2254

@ukanga ukanga enabled auto-merge (squash) June 10, 2022 01:53
@ukanga ukanga merged commit 109892f into main Jun 10, 2022
@ukanga ukanga deleted the fix-data-type-2254 branch June 10, 2022 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Data Type Change for Returned Results
2 participants