LogoLogo
About
  • Home
  • Guides
  • BDK
  • REST API
  • JSON
    • Overview
  • Converting JSON to String
  • Getting Data from JSON
  • Creating and Merging JSON Objects
  • Modifying JSON
Powered by GitBook
On this page
  • Creating an Empty JSON Object
  • Merging Two JSON Objects

Was this helpful?

Export as PDF

Creating and Merging JSON Objects

Creating an Empty JSON Object

To create an empty JSON object, use the following syntax:

create a json

Merging Two JSON Objects

To merge two JSON objects, use the following syntax:

merge the target json with the object json

In case of duplicate keys, the value from the object JSON will be used. For example:

Example
target json
    {
        "name": "John",
        "age": 30
    }
object json
    {
        "place": "USA",
        "age": 31
    }
final result json
    {
        "name": "John",
        "place": "USA"
        "age": 31
    }

This allows you to create new JSON objects and merge existing ones, combining their data as needed.

Last updated 1 month ago

Was this helpful?