Schema
run testsunknown
python
2 years ago
316 B
8
Indexable
def get_schema_field_names(filename):
"""Extract the list of fieldNames defined in the schema from a given JSON file."""
with open(filename, 'r') as file:
data = json.load(file)
schema = data.get("feed", {}).get("catalog", {}).get("schema", [])
return [field["fieldName"] for field in schema]Editor is loading...