json
Package json provides JSON encoding and decoding for durable programs. Copyright 2020 The Bazel Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. load("json", ...)
Example
@example
json
Package json provides JSON encoding and decoding for durable programs. Copyright 2020 The Bazel Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. load("json", ...)
Functions
encode(input: Value)
Example:
load("json", "json")
json.encode({})
json.encode("")
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
input | Value | ✓ |
Returns: String
encode_indent(input: Value)
Example:
load("json", "json")
json.encode_indent({})
json.encode_indent("")
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
input | Value | ✓ |
Returns: String
encode(input: String)
Example:
load("json", "json")
json.decode("{}")
json.decode("FOO")
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
input | String | ✓ |
Returns: Value