Skip to main content

infer_json_key

No overview available.

def infer_json_key(
target: string,
candidates: array,
context: string = null
) - > string

Infers the most likely JSON key from a list of candidates based on a target name and optional context. This is used to map dynamic or fuzzy input keys to a known schema.

Parameters

NameTypeDescription
targetstringThe desired field name or concept to find a match for.
candidatesarrayA list of available keys found in the source JSON object.
contextstring = nullAdditional metadata or surrounding text to improve matching accuracy in ambiguous cases.

Returns

TypeDescription
stringThe best-matching key from the candidates list, or null if no confident match is found.