Expected
When autoentities discovers a table with a space in its name (e.g., Order Items), the generated entity name should be sanitized to produce a valid URL path — or dab auto-config should warn the user before generating the config.
Actual
dab validate fails with:
fail: The rest path: dbo_Order Items for entity: dbo_Order Items contains whitespace which is not allowed in URL paths.
fail: Config is invalid.
The {schema}_{object} name pattern passes the space through verbatim, producing /api/dbo_Order Items, which is an invalid URL path. The user must manually add an exclude pattern to work around this.
Suggestion
Replace spaces (and other URL-unsafe characters) in the interpolated entity name with a safe delimiter. For example, if the name pattern is {schema}_{object}, transform dbo_Order Items → dbo_OrderItems or dbo_Order_Items before assigning the REST path. This matches how the engine already validates the final name — it should sanitize, not just reject.
static string SanitizeEntityName(string name)
{
var sb = new StringBuilder(name.Length);
bool capitalizeNext = false;
foreach (char c in name)
{
if (char.IsWhiteSpace(c))
{
capitalizeNext = true;
continue;
}
sb.Append(capitalizeNext ? char.ToUpperInvariant(c) : c);
capitalizeNext = false;
}
return sb.ToString();
}
"dbo_Order Items" → "dbo_OrderItems"
Expected
When
autoentitiesdiscovers a table with a space in its name (e.g.,Order Items), the generated entity name should be sanitized to produce a valid URL path — ordab auto-configshould warn the user before generating the config.Actual
dab validatefails with:The
{schema}_{object}name pattern passes the space through verbatim, producing/api/dbo_Order Items, which is an invalid URL path. The user must manually add anexcludepattern to work around this.Suggestion
Replace spaces (and other URL-unsafe characters) in the interpolated entity name with a safe delimiter. For example, if the name pattern is
{schema}_{object}, transformdbo_Order Items→dbo_OrderItemsordbo_Order_Itemsbefore assigning the REST path. This matches how the engine already validates the final name — it should sanitize, not just reject."dbo_Order Items"→"dbo_OrderItems"