Skip to content

Commit ba9511a

Browse files
committed
Fix payload for a single item
1 parent 82e9f3d commit ba9511a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

pygeoapi/formatter/jsonfg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,10 @@ def write(self, data: dict, options: dict = {}) -> str:
7272
"""
7373

7474
try:
75-
fields = list(data["features"][0]["properties"].keys())
75+
if data.get("features"):
76+
fields = list(data["features"][0]["properties"].keys())
77+
else:
78+
fields = data["properties"].keys()
7679
except IndexError:
7780
LOGGER.error("no features")
7881
return str()

0 commit comments

Comments
 (0)