JSONValuesToLiterals
JSONValuesToLiterals converts a raw JSON object (values) into NamedLiterals using the provided type definitions in variableMap. This is a thin wrapper around jsonValueToLiteralWithFieldName that understands Flyte's LiteralType.
def JSONValuesToLiterals(
ctx: context.Context,
variableMap: *core.VariableMap,
values: *structpb.Struct
) - > []*task.NamedLiteral, error
Converts a raw JSON object (values) into NamedLiterals using the provided type definitions in variableMap. This is a thin wrapper around jsonValueToLiteralWithFieldName that understands Flyte's LiteralType.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, used for logging and cancellation. |
| variableMap | *core.VariableMap | A map describing the expected inputs, including their types and names, used to guide the conversion of JSON values to literals. |
| values | *structpb.Struct | A Struct whose fields are the raw JSON values to be converted into NamedLiterals. |
Returns
| Type | Description |
|---|---|
[]*task.NamedLiteral, error | A slice of NamedLiteral objects representing the converted JSON values, or an error if the conversion fails. |