> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.object

> 创建 new table marked as a JSON object，让 Real JSON encoder 将其作为 object 处理。

<div className="real-function-page">
  ```lua theme={null}
  json.object(source?: table): table
  ```

  ## 参数

  <ParamField path={"source"} type={"table"}>
    Optional source table，会 copy 到 new object table。若 omitted 或 nil，则返回 empty object table。
  </ParamField>

  ## 返回值

  <ResponseField name={"object"} type={"table"}>
    带有 Real JSON object marker 的 new table。Source entries 会被 copy，但不包括 Real JSON type marker。
  </ResponseField>

  ## 示例

  Create new table marked as a JSON object，包括 empty object。

  ```lua theme={null}
  local profile = json.object({
      name = "Guest",
      active = true,
  })
  local empty = json.object()

  print(json.encode(profile))
  print(json.encode(empty))
  ```
</div>
