{
  "openapi": "3.0.3",
  "info": {
    "title": "BN Mod Registry API",
    "description": "API for accessing Cataclysm: Bright Nights mod metadata. This is a static JSON API - all data is served from pre-generated files.",
    "version": "1.0.0",
    "license": {
      "name": "MIT",
      "url": "https://opensource.org/licenses/MIT"
    }
  },
  "servers": [
    {
      "url": "https://cataclysmbn.github.io/registry",
      "description": "Production"
    }
  ],
  "paths": {
    "/generated/mods.json": {
      "get": {
        "summary": "Get all mods",
        "description": "Returns an array of all mod manifests in the registry, sorted alphabetically by display name. Note: this list omits previous_releases to save bandwidth.",
        "operationId": "getMods",
        "tags": [
          "Mods"
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$schema": "http://json-schema.org/draft-07/schema#",
                    "type": "object",
                    "properties": {
                      "schema_version": {
                        "const": "1.0"
                      },
                      "package_type": {
                        "enum": [
                          "mod",
                          "soundpack"
                        ]
                      },
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^(?=.*\\S)[^/\\\\?#]+$"
                      },
                      "display_name": {
                        "type": "string"
                      },
                      "short_description": {
                        "type": "string",
                        "maxLength": 200
                      },
                      "description": {
                        "type": "string"
                      },
                      "author": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "license": {
                        "type": "string"
                      },
                      "homepage": {
                        "type": "string",
                        "format": "uri"
                      },
                      "version": {
                        "type": "string"
                      },
                      "yanked": {
                        "type": "object",
                        "properties": {
                          "reason": {
                            "type": "string",
                            "minLength": 1
                          }
                        },
                        "required": [
                          "reason"
                        ]
                      },
                      "dependencies": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "conflicts": {
                        "type": "object",
                        "additionalProperties": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "source": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "enum": [
                              "github_archive",
                              "gitlab_archive",
                              "direct_url"
                            ]
                          },
                          "url": {
                            "type": "string",
                            "format": "uri"
                          },
                          "commit_sha": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{40}$"
                          },
                          "extract_path": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type",
                          "url"
                        ]
                      },
                      "categories": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "tags": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      },
                      "icon_url": {
                        "type": "string"
                      },
                      "modinfo_url": {
                        "type": "string",
                        "format": "uri"
                      },
                      "uses_lua": {
                        "type": "boolean"
                      },
                      "lua_api_version": {
                        "type": "integer"
                      },
                      "autoupdate": {
                        "type": "object",
                        "properties": {
                          "type": {
                            "enum": [
                              "tag",
                              "commit"
                            ]
                          },
                          "update_url": {
                            "type": "string"
                          },
                          "branch": {
                            "type": "string"
                          },
                          "regex": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "type"
                        ]
                      },
                      "parent": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^(?=.*\\S)[^/\\\\?#]+$"
                      },
                      "last_updated": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "schema_version",
                      "id",
                      "display_name",
                      "short_description",
                      "author",
                      "license",
                      "version",
                      "source"
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/generated/mods/{mod_id}.json": {
      "get": {
        "summary": "Get a single mod",
        "description": "Returns the manifest for a specific mod by its ID.",
        "operationId": "getMod",
        "tags": [
          "Mods"
        ],
        "parameters": [
          {
            "name": "mod_id",
            "in": "path",
            "required": true,
            "description": "The unique identifier of the mod",
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9][a-z0-9_-]*$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "$schema": "http://json-schema.org/draft-07/schema#",
                  "type": "object",
                  "properties": {
                    "schema_version": {
                      "const": "1.0"
                    },
                    "package_type": {
                      "enum": [
                        "mod",
                        "soundpack"
                      ]
                    },
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?=.*\\S)[^/\\\\?#]+$"
                    },
                    "display_name": {
                      "type": "string"
                    },
                    "short_description": {
                      "type": "string",
                      "maxLength": 200
                    },
                    "description": {
                      "type": "string"
                    },
                    "author": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "license": {
                      "type": "string"
                    },
                    "homepage": {
                      "type": "string",
                      "format": "uri"
                    },
                    "version": {
                      "type": "string"
                    },
                    "previous_releases": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "version": {
                            "type": "string"
                          },
                          "source": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "enum": [
                                  "github_archive",
                                  "gitlab_archive",
                                  "direct_url"
                                ]
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "commit_sha": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{40}$"
                              },
                              "extract_path": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "type",
                              "url"
                            ]
                          },
                          "released_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        },
                        "required": [
                          "version",
                          "source"
                        ]
                      }
                    },
                    "yanked": {
                      "type": "object",
                      "properties": {
                        "reason": {
                          "type": "string",
                          "minLength": 1
                        }
                      },
                      "required": [
                        "reason"
                      ]
                    },
                    "dependencies": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "conflicts": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "source": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "enum": [
                            "github_archive",
                            "gitlab_archive",
                            "direct_url"
                          ]
                        },
                        "url": {
                          "type": "string",
                          "format": "uri"
                        },
                        "commit_sha": {
                          "type": "string",
                          "pattern": "^[a-f0-9]{40}$"
                        },
                        "extract_path": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "url"
                      ]
                    },
                    "categories": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "tags": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "icon_url": {
                      "type": "string"
                    },
                    "modinfo_url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "uses_lua": {
                      "type": "boolean"
                    },
                    "lua_api_version": {
                      "type": "integer"
                    },
                    "autoupdate": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "enum": [
                            "tag",
                            "commit"
                          ]
                        },
                        "update_url": {
                          "type": "string"
                        },
                        "branch": {
                          "type": "string"
                        },
                        "regex": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "type"
                      ]
                    },
                    "parent": {
                      "type": "string",
                      "minLength": 1,
                      "pattern": "^(?=.*\\S)[^/\\\\?#]+$"
                    },
                    "last_updated": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "schema_version",
                    "id",
                    "display_name",
                    "short_description",
                    "author",
                    "license",
                    "version",
                    "source"
                  ]
                }
              }
            }
          },
          "404": {
            "description": "Mod not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "ModManifest": {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "type": "object",
        "properties": {
          "schema_version": {
            "const": "1.0"
          },
          "package_type": {
            "enum": [
              "mod",
              "soundpack"
            ]
          },
          "id": {
            "type": "string",
            "minLength": 1,
            "pattern": "^(?=.*\\S)[^/\\\\?#]+$"
          },
          "display_name": {
            "type": "string"
          },
          "short_description": {
            "type": "string",
            "maxLength": 200
          },
          "description": {
            "type": "string"
          },
          "author": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "license": {
            "type": "string"
          },
          "homepage": {
            "type": "string",
            "format": "uri"
          },
          "version": {
            "type": "string"
          },
          "previous_releases": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "version": {
                  "type": "string"
                },
                "source": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "enum": [
                        "github_archive",
                        "gitlab_archive",
                        "direct_url"
                      ]
                    },
                    "url": {
                      "type": "string",
                      "format": "uri"
                    },
                    "commit_sha": {
                      "type": "string",
                      "pattern": "^[a-f0-9]{40}$"
                    },
                    "extract_path": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "url"
                  ]
                },
                "released_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "required": [
                "version",
                "source"
              ]
            }
          },
          "yanked": {
            "type": "object",
            "properties": {
              "reason": {
                "type": "string",
                "minLength": 1
              }
            },
            "required": [
              "reason"
            ]
          },
          "dependencies": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1
            }
          },
          "conflicts": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "minLength": 1
            }
          },
          "source": {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "github_archive",
                  "gitlab_archive",
                  "direct_url"
                ]
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "commit_sha": {
                "type": "string",
                "pattern": "^[a-f0-9]{40}$"
              },
              "extract_path": {
                "type": "string"
              }
            },
            "required": [
              "type",
              "url"
            ]
          },
          "categories": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "icon_url": {
            "type": "string"
          },
          "modinfo_url": {
            "type": "string",
            "format": "uri"
          },
          "uses_lua": {
            "type": "boolean"
          },
          "lua_api_version": {
            "type": "integer"
          },
          "autoupdate": {
            "type": "object",
            "properties": {
              "type": {
                "enum": [
                  "tag",
                  "commit"
                ]
              },
              "update_url": {
                "type": "string"
              },
              "branch": {
                "type": "string"
              },
              "regex": {
                "type": "string"
              }
            },
            "required": [
              "type"
            ]
          },
          "parent": {
            "type": "string",
            "minLength": 1,
            "pattern": "^(?=.*\\S)[^/\\\\?#]+$"
          },
          "last_updated": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "schema_version",
          "id",
          "display_name",
          "short_description",
          "author",
          "license",
          "version",
          "source"
        ]
      }
    }
  }
}
