Skip to content

Commit f0b85f7

Browse files
committed
Fix payload for a single item
1 parent a0a3ff2 commit f0b85f7

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)