Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Mage ai Mage ai GitHub Events Schema

From Leeroopedia


Knowledge Sources
Domains Data_Integration, GitHub, Schema
Last Updated 2026-02-09 00:00 GMT

Overview

JSON Schema definition for GitHub event records used by the Singer-based GitHub source connector.

Description

This schema defines the structure and types for event data extracted from the GitHub Events API. It is loaded by the GitHub source connector during stream discovery to validate and type-check extracted records. The schema follows the JSON Schema specification and includes top-level properties such as _sdc_repository, actor (with nested user details like avatar_url, login, and id), created_at, id, org (with nested organization details), payload, distinct_size, head, push_id, ref, size, public, repo, and type. The root type is ["null", "object"], allowing nullable records.

Usage

This schema is automatically loaded by the GitHub source connector during the discovery phase. It defines the available columns and their types for the events stream.

Code Reference

Source Location

  • Repository: mage-ai
  • File: mage_integrations/mage_integrations/sources/github/tap_github/schemas/events.json
  • Lines: 1-1055

Signature

{
  "type": ["null", "object"],
  "properties": {
    "_sdc_repository": { "type": ["null", "string"] },
    "actor": { "type": ["null", "object"], "properties": { "avatar_url": {}, "display_login": {}, "gravatar_id": {}, "id": {}, "login": {}, "url": {} } },
    "created_at": { "type": ["null", "string"] },
    "id": { "type": ["null", "number"] },
    "org": { "type": ["null", "object"], "properties": { "avatar_url": {}, "gravatar_id": {}, "id": {}, "login": {} } },
    "payload": { "type": ["null", "object"], "..." : "..." },
    "public": { "type": ["null", "boolean"] },
    "repo": { "type": ["null", "object"], "..." : "..." },
    "type": { "type": ["null", "string"] }
  }
}

Import

# Loaded automatically by Source.load_schemas_from_folder()
# Path: mage_integrations/mage_integrations/sources/github/tap_github/schemas/events.json

I/O Contract

Inputs

Name Type Required Description
(none) JSON file Yes Loaded from disk by schema loader

Outputs

Name Type Description
schema dict JSON Schema object with properties, types, and format constraints

Usage Examples

import json
import os

schema_path = os.path.join(
    "mage_integrations/mage_integrations/sources/github/tap_github/schemas",
    "events.json"
)
with open(schema_path) as f:
    schema = json.load(f)

print(list(schema["properties"].keys()))

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment