Skip to main content

LiteralsToLaunchFormJson

LiteralsToLaunchFormJson converts a list of NamedLiterals accompanied by a VariableMap to RSJF-compliant JSON schema format.

def LiteralsToLaunchFormJson(
ctx: context.Context,
literals: []*task.NamedLiteral,
variableMap: *core.VariableMap
) - > *structpb.Struct

Converts a list of NamedLiterals accompanied by a VariableMap to RSJF-compliant JSON schema format. This function is used to generate a launch form schema based on the provided literals and their corresponding variable definitions.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for logging and cancellation.
literals[]*task.NamedLiteralA slice of NamedLiteral objects, each representing a named input field for the launch form.
variableMap*core.VariableMapA map containing variable definitions, used to retrieve type information and constraints for each NamedLiteral.

Returns

TypeDescription
*structpb.StructA structpb.Struct representing the RSJF-compliant JSON schema for the launch form, or an error if the conversion fails.