Bug: ImproperlyConfiguredException — path parameters missing type annotation
Describe the bug
apiup crashes at startup when the spec contains path parameters like {skillId}.
Error
litestar.exceptions.http_exceptions.ImproperlyConfiguredException:
Path parameters should be declared with a type using the following pattern:
'{parameter_name:type}', e.g. '/my-path/{my_param:int}'
in path: '/skills/{skillId}'
Root cause
OpenAPI uses {skillId} — Litestar requires {skillId:str}. No conversion was done between the two formats.
Fix
Add _openapi_path_to_litestar() in server.py using a regex substitution:
_PARAM_RE = re.compile(r"\{(\w+)\}")
def _openapi_path_to_litestar(path: str) -> str:
return _PARAM_RE.sub(r"{\1:str}", path)
Labels
bug
Bug:
ImproperlyConfiguredException— path parameters missing type annotationDescribe the bug
apiupcrashes at startup when the spec contains path parameters like{skillId}.Error
Root cause
OpenAPI uses
{skillId}— Litestar requires{skillId:str}. No conversion was done between the two formats.Fix
Add
_openapi_path_to_litestar()inserver.pyusing a regex substitution:Labels
bug