{"record":{"id":"d423dc0a268cefe2","repo":"Yeachan-Heo/oh-my-codex","slug":"questions-index-type-multi-answerable-conflict","errorCode":null,"errorMessage":"questions[${index}] type=multi-answerable conflicts with multi_select=false","messagePattern":"questions\\[(.+?)\\] type=multi-answerable conflicts with multi_select=false","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/question/types.ts","lineNumber":160,"sourceCode":"  const question = safeString(input.question).trim();\n  const header = safeString(input.header).trim() || (index === 0 ? inheritedHeader : undefined);\n  const other_label = safeString(input.other_label).trim() || 'Other';\n  const allow_other = input.allow_other !== false;\n  const rawMultiSelect = input.multi_select;\n  const parsedType = parseQuestionType(input.type);\n  const rawOptions = Array.isArray(input.options) ? input.options : [];\n  const id = safeString(input.id).trim() || `q-${index + 1}`;\n\n  if (!question) throw new Error(`questions[${index}].question must be a non-empty string`);\n  if (!id) throw new Error(`questions[${index}].id must be a non-empty string`);\n  if (rawOptions.length === 0 && !allow_other) {\n    throw new Error(`questions[${index}].options must be a non-empty array unless allow_other is true`);\n  }\n  if (parsedType === 'single-answerable' && rawMultiSelect === true) {\n    throw new Error(`questions[${index}] type=single-answerable conflicts with multi_select=true`);\n  }\n  if (parsedType === 'multi-answerable' && rawMultiSelect === false) {\n    throw new Error(`questions[${index}] type=multi-answerable conflicts with multi_select=false`);\n  }\n\n  const type = getNormalizedQuestionType({\n    type: parsedType,\n    multi_select: rawMultiSelect === true,\n  });\n  return {\n    id,\n    ...(header ? { header } : {}),\n    question,\n    options: rawOptions.map((option, optionIndex) => normalizeOption(option, optionIndex)),\n    allow_other,\n    other_label,\n    multi_select: type === 'multi-answerable',\n    type,\n  };\n}\n","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/Yeachan-Heo/oh-my-codex/blob/3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2/src/question/types.ts#L142-L178","documentation":"Thrown by normalizeQuestionItem when a question declares type=multi-answerable but multi_select is explicitly false. The library keeps the type field and the multi_select flag consistent, so contradictory declarations are rejected during input normalization rather than at render time.","triggerScenarios":"Passing a questions array item (or legacy single-question object) with type: 'multi-answerable' and multi_select: false to normalizeQuestionInput or any API that builds a QuestionRecord.","commonSituations":"Editing question JSON by hand, migrating from older schemas where multi_select defaulted differently, or copy-pasting a single-answerable template and changing only the type field.","solutions":["Set multi_select: true on the multi-answerable question (or omit it if the library derives it from type)","Or change type back to 'single-answerable' if only one answer is intended","Audit generated question files with a JSON schema validator before feeding them to the UI"],"exampleFix":"// before\n{ \"questions\": [{ \"id\": \"q1\", \"type\": \"multi-answerable\", \"multi_select\": false, \"options\": [...] }] }\n// after\n{ \"questions\": [{ \"id\": \"q1\", \"type\": \"multi-answerable\", \"multi_select\": true, \"options\": [...] }] }","handlingStrategy":"validation","validationCode":"for (const q of input.questions ?? []) {\n  if (q.type === 'multi-answerable' && q.multi_select === false) throw new Error(`q ${q.id}: multi-answerable requires multi_select !== false`);\n}","typeGuard":"const isConsistentQuestion = (q: any) =>\n  !(q?.type === 'multi-answerable' && q.multi_select === false) &&\n  !(q?.type === 'single-answerable' && q.multi_select === true);","tryCatchPattern":null,"preventionTips":["Never set multi_select explicitly to false on multi-answerable questions","Add a JSON schema check in CI for question files"],"tags":["question-schema","validation","config-conflict"],"backgroundTag":"schema-validation-failed","analyzedSha":"3ad79a8a6fe6e95fdbb8c00e40716fffe4011ce2","analyzedAt":"2026-08-27T22:18:39.783Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}