{"record":{"id":"e8ff2b787b5d3cc8","repo":"multica-ai/multica","slug":"value-must-be-true-or-false","errorCode":null,"errorMessage":"value must be true or false","messagePattern":"value must be true or false","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"server/internal/handler/property.go","lineNumber":350,"sourceCode":"\t\t\treturn nil, errors.New(\"value must be a URL string\")\n\t\t}\n\t\ts = strings.TrimSpace(s)\n\t\tif len(s) > maxPropertyURLValueLen {\n\t\t\treturn nil, fmt.Errorf(\"value must be %d characters or fewer\", maxPropertyURLValueLen)\n\t\t}\n\t\tu, err := url.Parse(s)\n\t\tif err != nil || (u.Scheme != \"http\" && u.Scheme != \"https\") || u.Host == \"\" {\n\t\t\treturn nil, errors.New(\"value must be an http(s) URL\")\n\t\t}\n\t\treturn json.Marshal(s)\n\tcase \"number\":\n\t\tif _, ok := v.(float64); !ok {\n\t\t\treturn nil, errors.New(\"value must be a number\")\n\t\t}\n\t\treturn json.Marshal(v)\n\tcase \"checkbox\":\n\t\tif _, ok := v.(bool); !ok {\n\t\t\treturn nil, errors.New(\"value must be true or false\")\n\t\t}\n\t\treturn json.Marshal(v)\n\tcase \"date\":\n\t\ts, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn nil, errors.New(\"value must be a date string in YYYY-MM-DD format\")\n\t\t}\n\t\tif _, err := time.Parse(\"2006-01-02\", s); err != nil {\n\t\t\treturn nil, errors.New(\"value must be a date string in YYYY-MM-DD format\")\n\t\t}\n\t\treturn json.Marshal(s)\n\tcase \"select\":\n\t\ts, ok := v.(string)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"value must be one of the option ids: %s\", selectOptionsHint(cfg))\n\t\t}\n\t\tif _, exists := propertyOptionIDs(cfg)[s]; !exists {\n\t\t\treturn nil, fmt.Errorf(\"value must be one of the option ids: %s\", selectOptionsHint(cfg))","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/multica-ai/multica/blob/2c0912b6ec764b373d44eeea1e80f0d9f11ab417/server/internal/handler/property.go#L332-L368","documentation":"validatePropertyValue requires checkbox-type property values to be JSON true or false. Any other JSON type — string \"true\", number 1/0, null in a value position (null at the top of validatePropertyValue gives a different 'cannot be null' error) — is rejected. The value is stored verbatim after the check.","triggerScenarios":"PUT/PATCH a checkbox property with {\"value\": \"true\"}, {\"value\": 1}, or {\"value\": 0}. Happens with checkbox inputs serialized by form libraries that emit \"on\"/\"off\" or 0/1 instead of booleans.","commonSituations":"HTML checkbox forms yielding \"on\" strings; SQLite/legacy columns storing 0/1 re-exported into the API; Python clients truthy-coercing values before JSON encoding.","solutions":["Send a real JSON boolean: {\"value\": true}","Convert form state with Boolean(x) or x === \"on\" before the request","To unset a checkbox, send null or use DELETE rather than false-if-you-mean-unset"],"exampleFix":"// before\n{ value: 1 }\n// after\n{ value: true }","handlingStrategy":"type-guard","validationCode":"if (def.type === 'checkbox') {\n  if (typeof value !== 'boolean') throw new Error('Property expects true/false');\n  payload.value = value;\n}","typeGuard":"function isCheckboxPropertyValue(v: unknown): v is boolean {\n  return typeof v === 'boolean';\n}","tryCatchPattern":null,"preventionTips":["Convert 'on'/'off' form values to booleans at the form boundary","Don't store 0/1 and send it raw","Distinguish false from unset: unset goes through DELETE/null"],"tags":["validation","boolean","issue-properties"],"backgroundTag":null,"analyzedSha":"2c0912b6ec764b373d44eeea1e80f0d9f11ab417","analyzedAt":"2026-08-15T13:25:18.241Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}