def getfields(jsondict: dict, types: bool = False):
    """Return list of field names or a name:type dict if types=True"""
    if types:
        return {
            f["name"]: f["type"].replace("esriFieldType", "") for f in jsondict["fields"]
        }
    else:
        return [f["name"] for f in jsondict["fields"]]