Json

1. JSON Syntax Rules

JSON syntax is derived from JavaScript object notation syntax:

  • Data is in name/value pairs

  • Data is separated by commas

  • Curly braces hold objects

  • Square brackets hold arrays

The JSON format is almost identical to JavaScript objects.

In JSON, _keys _must be strings, written with double quotes:

In JavaScript, keys can be strings, numbers, or identifier names:

2. JSON values

in JSON, values must be one of the following data types:

  1. a string

  2. a number

  3. an object(JSON object)

  4. an array

  5. a boolean

  6. null

in JavaScript values can be all of the above, plus any other valid JavaScript expression, including:

  1. a function

  2. a date

  3. undefined

3.Jackson(API) Jackson Library

Jackson is a high-performance JSON processor for Java. It provides many ways of working including simple POJO converted to/from JSON for simple cases. Jackson provides a set of annotations for mapping too.

Last updated