def plugin_def_json(plugin_def):
    """Convert plugin defenition to json.

    Args:
        plugin_def: Plugin definition

    Returns:
        JSON of the plugin's definition
    """
    return {
        "name": plugin_def.name,
        "namespace": plugin_def.namespace,
        "hidden": plugin_def.hidden,
        "label": plugin_def.label,
        "logo_url": plugin_def.logo_url,
        "description": plugin_def.description,
        "variants": [
            {
                "name": v.name,  # noqa: WPS111
                "default": i == 0,  # noqa: WPS111
                "deprecated": v.deprecated,
            }
            for i, v in enumerate(plugin_def.variants)  # noqa: WPS111
        ],
    }