JsonArray
JSON formatted array argument.
Attributes
| Attribute | Type | Description |
|---|---|---|
| name | string = json array | The human-readable name of the parameter type used for error messages and help text. |
Methods
convert()
@classmethod
def convert(
value: any,
param: click.Parameter,
ctx: click.Context
) - > list
Converts a JSON-formatted string into a Python list or returns the value if it is already a list. This method parses the input string and validates that the resulting data structure is an array, raising a failure if the JSON is malformed or not a list.
Parameters
| Name | Type | Description |
|---|---|---|
| value | any | The raw input value to be converted, typically a JSON-encoded string or an existing list. |
| param | click.Parameter | The parameter object that this value is being converted for. |
| ctx | click.Context | The current Click execution context for the command. |
Returns
| Type | Description |
|---|---|
list | The parsed Python list representation of the input JSON array. |