fix: harden composite input authoring

This commit is contained in:
lda
2026-08-14 12:01:44 +07:00 Verified
parent 4493b56ebe
commit 89e934e65b
13 changed files with 326 additions and 60 deletions
@@ -19,6 +19,8 @@ export type SchemaField = {
readonly fallbackReason: string | null;
};
export const UNCONSTRAINED_SCHEMA_REASON = "The schema is unconstrained; edit JSON directly.";
export type FieldSource =
| { readonly mode: "literal"; readonly value: unknown }
| { readonly mode: "bind"; readonly sourcePath: string };
@@ -222,7 +224,7 @@ const normalizeField = (
const type = resolvedSchema.type;
if (type === undefined) {
return fallback(resolvedSchema, path, key, required, title, "The schema is unconstrained; edit JSON directly.");
return fallback(resolvedSchema, path, key, required, title, UNCONSTRAINED_SCHEMA_REASON);
}
if (type === "object") {