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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the operation, used for logging and cancellation. |
| jsonSchema | *structpb.Struct | The RSJF JSON schema as a structpb.Struct from which to extract named literals. This schema defines the structure and default values of the form fields. |
Returns
| Type | Description |
|---|---|
[]*task.NamedLiteral | A slice of NamedLiteral objects, where each object represents a field from the JSON schema with its name and a Literal value derived from its default. Returns an error if the schema is invalid or conversion fails. |