I am trying to add a slug field for content type models, but right now the only option that really works for this is the “text” field type. Unfortunately, text fields on content models do not allow any real validation (outside of “required” and min/max length). We therefore cannot enforce a casing on fields or have an auto-generated slug.
What this means is that I have to guess what case slugs will be at runtime and any casing conventions are derived exclusively from user behavior (rather than being programmatically enforced).
You can see how this can lead to problems in your own blog:
https://www.builder.io/c/docs/how-builder-works ← valid page
https://www.builder.io/c/docs/How-builder-works ← invalid page.
It is possible that this could be solved with
regex case-insensitive matching, but I am having difficulty getting that to work via your API. Furthermore, it means that this matching paradigm rests exclusively in the API getter logic, which would prove brittle and prone to programmer error.
Could we please get a dedicated
slug field type and/or more granular field type validations?