JsonEncodedStringArrayParser

Parses a backend field that's either a raw string or a JSON-encoded string array — a common "loose" wire shape for fields like definitions/examples that may be sent as a single string or a list depending on backend version/content source.

Functions

Link copied to clipboard
fun parseOrList(values: List<String>?): List<String>

Parses each value in values as a JSON string array (or passes it through as a single-item list), flattened.

Link copied to clipboard
fun parseOrPassthrough(value: String?, joinWith: String = ""): String

Parses value as a JSON string array and joins it with joinWith; passes through as-is otherwise.