{
 "openapi": "3.1.0",
 "info": {
  "title": "Race Point open data",
  "version": "1.0.0",
  "description": "Race Point (racepoint.net) shows FIS points, race penalties, results and world rankings for snow sports, from the official FIS points lists and FIS live timing. In alpine skiing it works out race points and penalty live while the race is still running. Read-only. Built every night from official FIS data. Race Point is independent and not affiliated with FIS; FIS results decide.",
  "contact": {
   "name": "Race Point",
   "url": "https://racepoint.net/alpine-skiing/kontakt.html"
  }
 },
 "servers": [
  {
   "url": "https://racepoint.net"
  }
 ],
 "paths": {
  "/api/v1/index.json": {
   "get": {
    "summary": "List of sports, current FIS points lists and endpoints",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Index"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/{sport}/races.json": {
   "get": {
    "summary": "Races with date, venue, category, penalty and number classified",
    "parameters": [
     {
      "name": "sport",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "alpine-skiing",
        "cross-country",
        "snowboard",
        "freestyle"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Races"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/{sport}/clubs.json": {
   "get": {
    "summary": "Clubs with athletes on the current FIS points list",
    "parameters": [
     {
      "name": "sport",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string",
       "enum": [
        "alpine-skiing",
        "cross-country",
        "snowboard",
        "freestyle"
       ]
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Clubs"
        }
       }
      }
     }
    }
   }
  },
  "/api/v1/alpine-skiing/formula.json": {
   "get": {
    "summary": "Alpine FIS points formula: F-values, max points, minimum penalty per category",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Formula"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "List": {
    "type": "object",
    "required": [
     "name",
     "valid_from",
     "valid_to",
     "source"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "valid_from": {
      "type": "string"
     },
     "valid_to": {
      "type": "string"
     },
     "source": {
      "type": "string"
     }
    }
   },
   "Index": {
    "type": "object",
    "required": [
     "name",
     "url",
     "publisher",
     "generated",
     "sports",
     "openapi"
    ],
    "properties": {
     "name": {
      "type": "string"
     },
     "url": {
      "type": "string"
     },
     "publisher": {
      "type": "string"
     },
     "generated": {
      "type": "string"
     },
     "openapi": {
      "type": "string"
     },
     "sports": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "id",
        "name",
        "list",
        "races",
        "clubs",
        "endpoints"
       ],
       "properties": {
        "id": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "list": {
         "type": "object",
         "required": [
          "name",
          "valid_from",
          "valid_to",
          "source"
         ],
         "properties": {
          "name": {
           "type": "string"
          },
          "valid_from": {
           "type": "string"
          },
          "valid_to": {
           "type": "string"
          },
          "source": {
           "type": "string"
          }
         }
        },
        "athletes": {
         "type": "integer"
        },
        "races": {
         "type": "integer"
        },
        "clubs": {
         "type": "integer"
        },
        "endpoints": {
         "type": "object",
         "required": [
          "races",
          "clubs"
         ],
         "properties": {
          "races": {
           "type": "string"
          },
          "clubs": {
           "type": "string"
          }
         }
        }
       }
      }
     }
    }
   },
   "Races": {
    "type": "object",
    "required": [
     "sport",
     "generated",
     "list",
     "count",
     "races"
    ],
    "properties": {
     "sport": {
      "type": "string"
     },
     "generated": {
      "type": "string"
     },
     "list": {
      "type": "object",
      "required": [
       "name",
       "valid_from",
       "valid_to",
       "source"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "valid_from": {
        "type": "string"
       },
       "valid_to": {
        "type": "string"
       },
       "source": {
        "type": "string"
       }
      }
     },
     "count": {
      "type": "integer"
     },
     "races": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "codex",
        "date",
        "venue",
        "nation",
        "category",
        "event",
        "sex",
        "upcoming",
        "url",
        "source",
        "checked"
       ],
       "properties": {
        "id": {
         "type": [
          "string",
          "null"
         ]
        },
        "codex": {
         "type": "string"
        },
        "date": {
         "type": "string",
         "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "venue": {
         "type": "string"
        },
        "nation": {
         "type": "string"
        },
        "category": {
         "type": "string"
        },
        "event": {
         "type": "string"
        },
        "sex": {
         "type": "string"
        },
        "applied_penalty": {
         "type": [
          "number",
          "null"
         ]
        },
        "calculated_penalty": {
         "type": [
          "number",
          "null"
         ]
        },
        "classified": {
         "type": [
          "integer",
          "null"
         ]
        },
        "upcoming": {
         "type": "boolean"
        },
        "url": {
         "type": "string"
        },
        "source": {
         "type": "string"
        },
        "checked": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "Clubs": {
    "type": "object",
    "required": [
     "sport",
     "generated",
     "list",
     "count",
     "clubs"
    ],
    "properties": {
     "sport": {
      "type": "string"
     },
     "generated": {
      "type": "string"
     },
     "list": {
      "type": "object",
      "required": [
       "name",
       "valid_from",
       "valid_to",
       "source"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "valid_from": {
        "type": "string"
       },
       "valid_to": {
        "type": "string"
       },
       "source": {
        "type": "string"
       }
      }
     },
     "count": {
      "type": "integer"
     },
     "clubs": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "name",
        "nation",
        "athletes",
        "url",
        "source",
        "checked"
       ],
       "properties": {
        "name": {
         "type": "string"
        },
        "nation": {
         "type": "string"
        },
        "athletes": {
         "type": "integer"
        },
        "url": {
         "type": "string"
        },
        "website": {
         "type": [
          "string",
          "null"
         ]
        },
        "source": {
         "type": "string"
        },
        "checked": {
         "type": "string"
        }
       }
      }
     }
    }
   },
   "Formula": {
    "type": "object",
    "required": [
     "generated",
     "list",
     "formula",
     "events",
     "categories"
    ],
    "properties": {
     "generated": {
      "type": "string"
     },
     "list": {
      "type": "object",
      "required": [
       "name",
       "valid_from",
       "valid_to",
       "source"
      ],
      "properties": {
       "name": {
        "type": "string"
       },
       "valid_from": {
        "type": "string"
       },
       "valid_to": {
        "type": "string"
       },
       "source": {
        "type": "string"
       }
      }
     },
     "formula": {
      "type": "object"
     },
     "events": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "event",
        "code",
        "sex",
        "f_value",
        "max_points"
       ],
       "properties": {
        "event": {
         "type": "string"
        },
        "code": {
         "type": "string"
        },
        "sex": {
         "type": "string"
        },
        "f_value": {
         "type": "number"
        },
        "max_points": {
         "type": "number"
        }
       }
      }
     },
     "categories": {
      "type": "array",
      "items": {
       "type": "object",
       "required": [
        "code",
        "name",
        "min_penalty"
       ],
       "properties": {
        "code": {
         "type": "string"
        },
        "name": {
         "type": "string"
        },
        "min_penalty": {
         "type": "number"
        },
        "level": {
         "type": "integer"
        }
       }
      }
     }
    }
   }
  }
 }
}