import json
from actions_logging.app_logging import logger


def is_valid_json_string(s: str) -> bool:
    """
    Validate if the given string is a valid JSON string.
    Args:
        s (str): The string to validate.
    Returns:
        bool: True if the string is valid JSON, False otherwise.
    """
    logger.debug("Starting JSON string validation")
    if not s:
        logger.info("Input string is empty or None")
        return False
    if not isinstance(s, str):
        logger.info("Input is not a string")
        return False
    try:
        json.loads(s)
        logger.info("Input string is a valid JSON")
        return True
    except json.JSONDecodeError:
        logger.info("Input string is not a valid JSON")
        return False
    except Exception as e:
        logger.error(f"Unexpected error during JSON validation: {e}")
        raise e
