Use tips for JSON files

Source: Internet
Author: User

1. json file supports two kinds of data structures: dictionaries and lists

    • A collection of name/value pairs: Key:value style;

    • An ordered list of values: is an array;

    • Check JSON legitimacy online: https://jsonlint.com/

2. JSON does not support annotations, but it can be implemented in the following two ways:

    • Key-value pair annotations, such as:

{          ' _comment ':'this iscommets',      'jsondata'  : {          key1:value1,          key2:value2,          ...    }  }    

    • JSON file used//or/*.... */comment, but use the json.minify () function to delete comments and spaces in the file before calling the JSON file, so that the annotated. json file is compiled. ( This method has yet to be verified, there is no Minify method in the JSON library )

Use tips for JSON files

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.