mirror of
https://github.com/openclaw/nix-openclaw.git
synced 2026-07-25 13:45:53 -04:00
Fix config-options oneOf list parsing
- Wrap oneOf list entries in parentheses during generation. - Regenerate openclaw-config-options.nix. Tests: not run (CI)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -150,13 +150,13 @@ const baseTypeForSchema = (schemaObj: JsonSchema, indent: string): string => {
|
||||
|
||||
if (schema.anyOf && Array.isArray(schema.anyOf) && schema.anyOf.length > 0) {
|
||||
const entries = schema.anyOf as JsonSchema[];
|
||||
const parts = entries.map((entry) => typeForSchema(entry, indent)).join(" ");
|
||||
const parts = entries.map((entry) => `(${typeForSchema(entry, indent)})`).join(" ");
|
||||
return `t.oneOf [ ${parts} ]`;
|
||||
}
|
||||
|
||||
if (schema.oneOf && Array.isArray(schema.oneOf) && schema.oneOf.length > 0) {
|
||||
const entries = schema.oneOf as JsonSchema[];
|
||||
const parts = entries.map((entry) => typeForSchema(entry, indent)).join(" ");
|
||||
const parts = entries.map((entry) => `(${typeForSchema(entry, indent)})`).join(" ");
|
||||
return `t.oneOf [ ${parts} ]`;
|
||||
}
|
||||
|
||||
@@ -166,7 +166,9 @@ const baseTypeForSchema = (schemaObj: JsonSchema, indent: string): string => {
|
||||
|
||||
const schemaType = schema.type;
|
||||
if (Array.isArray(schemaType) && schemaType.length > 0) {
|
||||
const parts = schemaType.map((entry) => typeForSchema({ type: entry }, indent)).join(" ");
|
||||
const parts = schemaType
|
||||
.map((entry) => `(${typeForSchema({ type: entry }, indent)})`)
|
||||
.join(" ");
|
||||
return `t.oneOf [ ${parts} ]`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user