{"record":{"id":"ed350fa1bb97ffd5","repo":"earendil-works/pi","slug":"object-required-must-be-a-string-array","errorCode":null,"errorMessage":"object required must be a string array","messagePattern":"object required must be a string array","errorType":"exception","errorClass":"UnsupportedStrictJsonSchemaError","httpStatus":null,"severity":"error","filePath":"packages/ai/src/api/constrained-sampling.ts","lineNumber":97,"sourceCode":"\t\tmakeJsonSchemaNodeStrict(schema.items);\n\t}\n\n\tconst isObjectSchema = schema.type === \"object\";\n\tif (schema.properties !== undefined && !isObjectSchema) {\n\t\tthrow new UnsupportedStrictJsonSchemaError(\"properties require type object\");\n\t}\n\tif (!isObjectSchema) return;\n\tif (schema.additionalProperties !== undefined && schema.additionalProperties !== false) {\n\t\tthrow new UnsupportedStrictJsonSchemaError(\"schema-valued or true additionalProperties is unsupported\");\n\t}\n\tif (schema.properties !== undefined && !isJsonSchemaObject(schema.properties)) {\n\t\tthrow new UnsupportedStrictJsonSchemaError(\"object properties must be a schema map\");\n\t}\n\tif (\n\t\tschema.required !== undefined &&\n\t\t(!Array.isArray(schema.required) || schema.required.some((key) => typeof key !== \"string\"))\n\t) {\n\t\tthrow new UnsupportedStrictJsonSchemaError(\"object required must be a string array\");\n\t}\n\n\tconst properties = schema.properties ?? {};\n\tconst propertyNames = Object.keys(properties);\n\tconst required = new Set(Array.isArray(schema.required) ? schema.required : []);\n\tif ([...required].some((key) => !propertyNames.includes(key))) {\n\t\tthrow new UnsupportedStrictJsonSchemaError(\"required contains an unknown property\");\n\t}\n\tfor (const [key, property] of Object.entries(properties)) {\n\t\tmakeJsonSchemaNodeStrict(property);\n\t\tif (!required.has(key) && !schemaAllowsNull(property)) {\n\t\t\tproperties[key] = { anyOf: [property, { type: \"null\" }] };\n\t\t}\n\t}\n\tschema.required = propertyNames;\n\tschema.additionalProperties = false;\n}\n","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/api/constrained-sampling.ts#L79-L115","documentation":"Error \"object required must be a string array\" thrown in earendil-works/pi.","triggerScenarios":"Thrown at packages/ai/src/api/constrained-sampling.ts:97 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Make required an array of property-name strings."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}