Skip to content

Commit

Permalink
docs: add documentation for the new lossy option of the `parse_json…
Browse files Browse the repository at this point in the history
…` vrl function (#21076)

* docs: add docs for the new lossy option of the parse_json vrl function

* Update parse_json.cue

* cue fmt

Signed-off-by: Jesse Szwedko <[email protected]>

* Fix whitespace

Signed-off-by: Jesse Szwedko <[email protected]>

---------

Signed-off-by: Jesse Szwedko <[email protected]>
Co-authored-by: Jesse Szwedko <[email protected]>
  • Loading branch information
jorgehermo9 and jszwedko authored Sep 5, 2024
1 parent b546f12 commit 7656ce0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions website/cue/reference/remap/functions/parse_json.cue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ remap: functions: parse_json: {
required: false
type: ["integer"]
},
{
name: "lossy"
description: """
Whether to parse the JSON in a lossy manner. Replaces invalid UTF-8 characters
with the Unicode character `�` (U+FFFD) if set to true, otherwise returns an error
if there are any invalid UTF-8 characters present.
"""
required: false
default: true
type: ["boolean"]
},
]
internal_failure_reasons: [
"`value` is not a valid JSON-formatted payload.",
Expand Down

0 comments on commit 7656ce0

Please sign in to comment.