Skip to main content

LaunchFormJsonToLiterals

LaunchFormJsonToLiterals converts an RSJF JSON schema to a list of NamedLiterals.

def LaunchFormJsonToLiterals(
ctx: context.Context,
jsonSchema: *structpb.Struct
) - > []*task.NamedLiteral

Converts an RSJF JSON schema to a list of NamedLiterals. This function is used to extract default values and types from a JSON schema definition, typically for populating form fields or defining task inputs.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the operation, used for logging and cancellation.
jsonSchema*structpb.StructThe RSJF JSON schema as a structpb.Struct, from which to extract named literals. This schema defines the structure and potential default values for various fields.

Returns

TypeDescription
[]*task.NamedLiteralA slice of NamedLiteral objects, where each object represents a field from the JSON schema with its name and a Literal value (if a default is present or it's an optional field without a default).