Skip to content

Commit

Permalink
Merge pull request #888 from nextstrain/fix/move-extensions-to-meta
Browse files Browse the repository at this point in the history
fix: move custom extensions to meta in export v2
  • Loading branch information
corneliusroemer authored Apr 8, 2022
2 parents 7db4dc4 + c3e7f06 commit 64ef713
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions augur/data/schema-export-v2.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@
"uniqueItems": true,
"minItems": 1
},
"extensions": {
"description": "Data to be passed through to the the resulting dataset JSON",
"$comment": "Any type is accepted"
},
"geo_resolutions": {
"description": "The available options for the geographic resolution dropdown, and their lat/long information",
"type": "array",
Expand Down Expand Up @@ -308,10 +312,6 @@
"items": {"$ref": "#/$defs/tree"}
}
]
},
"extensions": {
"description": "Data for use by applications other than auspice",
"$comment": "Any type is accepted"
}
},
"$defs": {
Expand Down
2 changes: 1 addition & 1 deletion augur/export_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ def run_v2(args):

# pass through any extensions block in the auspice config JSON without any changes / checking
if config.get("extensions"):
data_json["extensions"] = config["extensions"]
data_json["meta"]["extensions"] = config["extensions"]

# Write outputs - the (unified) dataset JSON intended for auspice & perhaps the ref root-sequence JSON
indent = {"indent": None} if args.minify_json else {}
Expand Down
10 changes: 5 additions & 5 deletions tests/functional/export_v2/dataset2.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@
"panels": [
"tree"
],
"extensions": {
"some_key": "some_value"
},
"title": "Minimal config with an extensions block",
"updated": "2021-06-09"
},
Expand Down Expand Up @@ -221,8 +224,5 @@
}
}
},
"version": "v2",
"extensions": {
"some_key": "some_value"
}
}
"version": "v2"
}

0 comments on commit 64ef713

Please sign in to comment.