Skip to content

Commit

Permalink
Merge pull request #337 from bento-platform/patch/serve-dats-file
Browse files Browse the repository at this point in the history
parse dats_file JSON content to object
  • Loading branch information
ppillot committed Sep 8, 2022
2 parents a18bd28 + 0a9118a commit 4079a08
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions chord_metadata_service/restapi/api_views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import logging

from collections import Counter
Expand Down Expand Up @@ -322,6 +323,13 @@ def public_dataset(_request):
"extra_properties"
)

# convert dats_file json content to dict
datasets = [
{
**d,
"dats_file": json.loads(d["dats_file"]) if d["dats_file"] else None
} for d in datasets]

return Response({
"datasets": datasets
})

0 comments on commit 4079a08

Please sign in to comment.