Skip to main content

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:

NameTypeRequiredDescription
inputValue

Returns: String


encode_indent(input: Value)

Example:

load("json", "json")
json.encode_indent({})
json.encode_indent("")

Parameters:

NameTypeRequiredDescription
inputValue

Returns: String


encode(input: String)

Example:

load("json", "json")
json.decode("{}")
json.decode("FOO")

Parameters:

NameTypeRequiredDescription
inputString

Returns: Value