earendil-works/pi · error · UnsupportedStrictJsonSchemaError
object required must be a string array
Error message
object required must be a string array
What it means
Error "object required must be a string array" thrown in earendil-works/pi.
Source
Thrown at packages/ai/src/api/constrained-sampling.ts:97
makeJsonSchemaNodeStrict(schema.items);
}
const isObjectSchema = schema.type === "object";
if (schema.properties !== undefined && !isObjectSchema) {
throw new UnsupportedStrictJsonSchemaError("properties require type object");
}
if (!isObjectSchema) return;
if (schema.additionalProperties !== undefined && schema.additionalProperties !== false) {
throw new UnsupportedStrictJsonSchemaError("schema-valued or true additionalProperties is unsupported");
}
if (schema.properties !== undefined && !isJsonSchemaObject(schema.properties)) {
throw new UnsupportedStrictJsonSchemaError("object properties must be a schema map");
}
if (
schema.required !== undefined &&
(!Array.isArray(schema.required) || schema.required.some((key) => typeof key !== "string"))
) {
throw new UnsupportedStrictJsonSchemaError("object required must be a string array");
}
const properties = schema.properties ?? {};
const propertyNames = Object.keys(properties);
const required = new Set(Array.isArray(schema.required) ? schema.required : []);
if ([...required].some((key) => !propertyNames.includes(key))) {
throw new UnsupportedStrictJsonSchemaError("required contains an unknown property");
}
for (const [key, property] of Object.entries(properties)) {
makeJsonSchemaNodeStrict(property);
if (!required.has(key) && !schemaAllowsNull(property)) {
properties[key] = { anyOf: [property, { type: "null" }] };
}
}
schema.required = propertyNames;
schema.additionalProperties = false;
}
View on GitHub (pinned to 4af9d21d3b)
Solutions
- Make required an array of property-name strings.
When it happens
Trigger: Thrown at packages/ai/src/api/constrained-sampling.ts:97 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/ed350fa1bb97ffd5.
Report an issue: GitHub.