How do I add comments to Json.NET output?

后端 未结 4 1571
攒了一身酷
攒了一身酷 2021-02-18 21:56

Is there a way I can automatically add comments to the serialised output from Json.NET?

Ideally, I\'d imagine it\'s something similar to the following:

pub         


        
4条回答
  •  忘了有多久
    2021-02-18 22:25

    The problem is that JSON as a file format doesn't support comments. One thing you could do - if the application reading the JSON file allows it - is to use additional properties as comments as suggested in this question: Can comments be used in JSON?

提交回复
热议问题