{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "https://www.ircatlas.org/v1/onboarding.schema.json",
    "title": "IRC Atlas onboarding feed",
    "description": "Tags, the networks under them, and starter channels, for a client's welcome screen. Fetch at most daily, ship a bundled copy as a fallback, and attribute as given in this file.",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "schema_version",
        "generated_at",
        "license",
        "attribution",
        "tags",
        "networks"
    ],
    "properties": {
        "schema_version": {
            "type": "integer",
            "enum": [
                1
            ]
        },
        "generated_at": {
            "type": "string",
            "format": "date-time"
        },
        "license": {
            "type": "string"
        },
        "attribution": {
            "type": "string"
        },
        "tags": {
            "description": "Each tag in use with the ids of its networks, largest first. A tag only featured channels have has no networks, so skip empty ones when listing topics.",
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "tag",
                    "name",
                    "networks"
                ],
                "properties": {
                    "tag": {
                        "type": "string"
                    },
                    "name": {
                        "description": "The tag's name to show people, in English.",
                        "type": "string"
                    },
                    "networks": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                }
            }
        },
        "networks": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "id",
                    "name",
                    "logo_url",
                    "description",
                    "tags",
                    "languages",
                    "activity",
                    "connection",
                    "sasl",
                    "website_url",
                    "registration_url",
                    "featured_channels"
                ],
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "logo_url": {
                        "description": "A 96×96 WebP. Null when the network has none, so show its initial instead.",
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "description": {
                        "type": "string"
                    },
                    "tags": {
                        "description": "The tags this network is listed under.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "languages": {
                        "description": "BCP 47 codes, most used first.",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "activity": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "users",
                            "channels"
                        ],
                        "properties": {
                            "users": {
                                "description": "Average users over the last 30 days. Null when not known.",
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "channels": {
                                "description": "Channels the network last reported, including ones too small to list. Null when not known.",
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            }
                        }
                    },
                    "connection": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "host",
                            "port",
                            "tls",
                            "certificate_valid",
                            "url"
                        ],
                        "properties": {
                            "host": {
                                "type": "string"
                            },
                            "port": {
                                "type": "integer"
                            },
                            "tls": {
                                "description": "False means passwords and messages travel unencrypted, so warn before connecting.",
                                "type": "boolean"
                            },
                            "certificate_valid": {
                                "description": "Null when tls is false, or when the certificate hasn't been checked yet.",
                                "type": [
                                    "boolean",
                                    "null"
                                ]
                            },
                            "url": {
                                "description": "An ircs:// or irc:// link.",
                                "type": "string"
                            }
                        }
                    },
                    "sasl": {
                        "type": "boolean"
                    },
                    "website_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "registration_url": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "featured_channels": {
                        "description": "Starter channels, which may be empty. Channels with fewer than 10 users at the last channel list are left out.",
                        "type": "array",
                        "items": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "name",
                                "reason",
                                "users",
                                "tags",
                                "language"
                            ],
                            "properties": {
                                "name": {
                                    "type": "string"
                                },
                                "reason": {
                                    "type": "string"
                                },
                                "users": {
                                    "description": "Users at the last channel list, up to a week old. Null when the channel hasn't been seen recently.",
                                    "type": [
                                        "integer",
                                        "null"
                                    ]
                                },
                                "tags": {
                                    "description": "Assigned by a classifier from the channel's name and topic, and not reviewed by a person. Empty when not classified.",
                                    "type": "array",
                                    "items": {
                                        "type": "string"
                                    }
                                },
                                "language": {
                                    "description": "The topic's language as a BCP 47 code, from the same classifier and not reviewed by a person. Null when not known.",
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
