Open topic with navigation

# LuaJsonObject:new

The constructor for a `LuaJsonObject` object (creates a new `LuaJsonObject`).

If you do not specify any attributes to assign to the object (by omitting the `attributes` argument), an empty object is created.

## Syntax

    LuaJsonObject:new( [attributes] )

## Arguments

Argument | Description
--- | ---
`attributes` | (lua_json_object_type) A table of attributes (name/value pairs) to assign to the object. The keys in the table must be strings which specify the names of the attributes. Each value can be a Boolean, float, integer, string, LuaJsonObject, LuaJsonArray, LuaJsonValue, or nil. TIP: In Lua, keys in a table cannot be assigned the value of `nil`. If you want to have a null value (`nil` in Lua), you can do the following: `LuaJsonObject:new( { key=LuaJsonValue:new(nil) } )`.

## Returns

(LuaJsonObject). The new `LuaJsonObject` object.

## Example

The following is a simple JSON object:

    {"product":"IDOL","version":11}

To create a `LuaJsonObject` object to represent this JSON object:

    local myJsonObject = LuaJsonObject:new( { product="IDOL" , version=11 } )

© 2017 Hewlett Packard Enterprise Development LP | Send documentation feedback to HPE Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a web mail client, and send this email to AutonomyTPFeedback@hpe.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_HP_HTML5_bannerTitle.htm