Can comments be used in JSON?

后端 未结 30 1645
别跟我提以往
别跟我提以往 2020-11-22 02:16

Can I use comments inside a JSON file? If so, how?

30条回答
  •  礼貌的吻别
    2020-11-22 02:30

    In my case, I need to use comments for debug purposes right before the output of the JSON structure. So I decided to use debug information in the HTTP header, to avoid breaking the client:

    header("My-Json-Comment: Yes, I know it's a workaround ;-) ");
    

提交回复
热议问题