def METHOD_NAME(self, max: int, parent_schema: dict) -> dict:
    vartype = parent_schema["type"]
    if vartype == "str":
        return {"maxLength": max}
    if vartype == "list":
        return {"maxItems": max}
    return {}