larksuite/cli · error
schema default is not valid JSON: %w
Error message
schema default is not valid JSON: %w
What it means
Schema tag guard: the default token's value is not parseable as JSON, so the field default cannot be represented in the generated schema.
Source
Thrown at shortcuts/common/typed_compile_args.go:441
case "nullable", "nonnullable":
if hasValue {
return result, fmt.Errorf("schema token %s does not accept a value", key)
}
if result.nullable != nil {
return result, fmt.Errorf("schema cannot declare both nullable and nonnullable")
}
v := key == "nullable"
result.nullable = &v
case "default":
if !hasValue || value == "" {
return result, fmt.Errorf("schema default requires a JSON literal")
}
if !input {
return result, fmt.Errorf("Data field cannot declare default")
}
var decoded any
if err := json.Unmarshal([]byte(value), &decoded); err != nil {
return result, fmt.Errorf("schema default is not valid JSON: %w", err)
}
result.defaultValue = typedInputDefault{Set: true, Value: decoded}
case "enum":
if !hasValue || value == "" {
return result, fmt.Errorf("schema enum requires at least one value")
}
result.enum = strings.Split(value, "|")
case "format":
if !hasValue || value == "" {
return result, fmt.Errorf("schema format requires a name")
}
result.format = value
case "minLength":
v, err := parseNonnegativeInt(value)
if err != nil {
return result, fmt.Errorf("schema minLength: %w", err)
}
result.minLength = &vView on GitHub (pinned to 7fd6ef3c07)
Solutions
- Use JSON syntax, e.g. quote strings: default:"\"v\""
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at shortcuts/common/typed_compile_args.go:441 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of larksuite/cli@7fd6ef3c07 (2026-09-04).
Data as JSON: /api/errors/77a0cc04420a0f2d.
Report an issue: GitHub.