form field fixes

This commit is contained in:
2026-06-05 17:05:23 +05:30
parent a51fb62fd7
commit 1ab97fc0e4
3 changed files with 18 additions and 10 deletions

View File

@@ -76,6 +76,12 @@ function parseSchemaFields(
}
const type = mapOpenApiType(resolvedProp);
if (type === 'enum' && (!resolvedProp.enum || resolvedProp.enum.length === 0)) {
throw new Error(
`OpenAPI schema error: field "${resourceName}.${key}" is type "enum" but has no enum values. ` +
`Add an "enum" array with at least one value to the OpenAPI schema definition.`
);
}
const override = overrides[key];
// Explicitly skip 'id' as it's the primary key and handled elsewhere