Firebase - Invalid JSON data or key values. Key values can’t contain $ # [ ] / or

后端 未结 9 2275
陌清茗
陌清茗 2020-12-31 03:34

I\'m trying to import my JSON file into my Firebase but it keeps giving me this error. I don\'t know why this JSON file isn\'t allowed to be imported into since JSONLint say

9条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-31 04:27

    I just found one more reason when Firebase throws this error:

    This was the data firebase refused to upload:

     {
                "S. No.": 2,
                "University Name": "Acharya Nagarjuna University, Guntur (Id: U-0003)",
                "College Name": "Abhinav Institute of Management & Technology (Id: C-39450)",
                "College Type": "Affiliated College",
                "State Name": "Andhra Pradesh",
                "District Name": "Prakasam"
              } 
    

    I thought of changing the key name of "S. No." and it worked.

    {
                "S": 2,
                "University Name": "Acharya Nagarjuna University, Guntur (Id: U-0003)",
                "College Name": "Abhinav Institute of Management & Technology (Id: C-39450)",
                "College Type": "Affiliated College",
                "State Name": "Andhra Pradesh",
                "District Name": "Prakasam"
              } 
    

    The Firebase was accepting the later format (I believe the problem was with .(dot) followed by space.) I hope this helps!!!

提交回复
热议问题