{
  "openapi": "3.1.0",
  "info": {
    "title": "Meldotia Public API",
    "version": "1.0.0",
    "summary": "Read-only access to the Meldotia venture studio portfolio.",
    "description": "The Meldotia Public API exposes the Meldotia studio profile and its ventures\n(MetroLogix, ThirdChoice, TrafficOS) as JSON. It is public, read-only and\nrequires no authentication, API key, or registration.\n\nEvery HTML page on the site also has a Markdown representation, available\neither by appending `.md` to the path or by sending `Accept: text/markdown`.\nAll negotiated responses send `Vary: Accept, Accept-Encoding`.\n\nErrors always use the JSON envelope described by the `Error` schema, never HTML.",
    "contact": {
      "name": "Meldotia",
      "email": "kayu.ling@meldotia.com",
      "url": "https://www.meldotia.com/developers"
    },
    "license": {
      "name": "CC BY 4.0",
      "identifier": "CC-BY-4.0"
    },
    "termsOfService": "https://www.meldotia.com/developers"
  },
  "servers": [
    {
      "url": "https://www.meldotia.com",
      "description": "Production"
    }
  ],
  "externalDocs": {
    "description": "Meldotia developer & agent documentation",
    "url": "https://www.meldotia.com/developers"
  },
  "tags": [
    {
      "name": "Studio",
      "description": "Facts about the Meldotia venture studio."
    },
    {
      "name": "Ventures",
      "description": "The ventures Meldotia is building."
    },
    {
      "name": "Meta",
      "description": "Service metadata and health."
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "tags": [
          "Meta"
        ],
        "operationId": "getApiIndex",
        "summary": "Index of every public Meldotia API endpoint.",
        "responses": {
          "200": {
            "description": "The endpoint index.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "No acceptable representation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/health": {
      "get": {
        "tags": [
          "Meta"
        ],
        "operationId": "getHealth",
        "summary": "Liveness probe.",
        "responses": {
          "200": {
            "description": "The service is healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "No acceptable representation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/site": {
      "get": {
        "tags": [
          "Studio"
        ],
        "operationId": "getSite",
        "summary": "Studio profile, contact details, and machine-readable resources.",
        "responses": {
          "200": {
            "description": "The studio profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Site"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "No acceptable representation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/ventures": {
      "get": {
        "tags": [
          "Ventures"
        ],
        "operationId": "listVentures",
        "summary": "List every Meldotia venture.",
        "parameters": [
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Language of the returned venture copy.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Every venture.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VentureList"
                }
              }
            }
          },
          "400": {
            "description": "An query parameter was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "No acceptable representation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/ventures/{slug}": {
      "get": {
        "tags": [
          "Ventures"
        ],
        "operationId": "getVenture",
        "summary": "Fetch one venture, including its full Markdown dossier when published.",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Venture identifier.",
            "schema": {
              "type": "string",
              "enum": [
                "metro-logix",
                "third-choice",
                "traffic-os"
              ]
            }
          },
          {
            "name": "locale",
            "in": "query",
            "required": false,
            "description": "Language of the returned venture copy.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ja"
              ],
              "default": "en"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The venture.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Venture"
                }
              },
              "text/markdown": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "A query parameter was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No venture exists with that slug, or it has no copy in the requested locale.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "406": {
            "description": "No acceptable representation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/openapi": {
      "get": {
        "tags": [
          "Meta"
        ],
        "operationId": "getOpenApiDocument",
        "summary": "This document.",
        "responses": {
          "200": {
            "description": "The OpenAPI document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "405": {
            "description": "The HTTP method is not supported.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "status",
              "message",
              "hint"
            ],
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable, machine-readable error identifier.",
                "examples": [
                  "venture_not_found"
                ]
              },
              "status": {
                "type": "integer",
                "description": "HTTP status code, repeated in the body."
              },
              "message": {
                "type": "string",
                "description": "Human-readable description of what went wrong."
              },
              "hint": {
                "type": "string",
                "description": "How to resolve or work around the error."
              },
              "documentation": {
                "type": "string",
                "format": "uri"
              },
              "request": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string"
                  },
                  "path": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "Health": {
        "type": "object",
        "required": [
          "status",
          "service",
          "version"
        ],
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "ok"
            ]
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "time": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApiIndex": {
        "type": "object",
        "required": [
          "object",
          "service",
          "endpoints"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "index"
            ]
          },
          "service": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "documentation": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "method",
                "path",
                "description"
              ],
              "properties": {
                "method": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Site": {
        "type": "object",
        "required": [
          "object",
          "name",
          "url"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "site"
            ]
          },
          "name": {
            "type": "string"
          },
          "tagline": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "founder": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "location": {
            "type": "string"
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "social": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "resources": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "title",
                "url"
              ],
              "properties": {
                "title": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Venture": {
        "type": "object",
        "required": [
          "object",
          "slug",
          "title",
          "category",
          "status",
          "description",
          "url"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "venture"
            ]
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "tagline": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "longDescription": {
            "type": "string"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "ja"
            ]
          },
          "availableLocales": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "en",
                "ja"
              ]
            }
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The HTML page for this venture."
          },
          "markdownUrl": {
            "type": "string",
            "format": "uri",
            "description": "The Markdown representation of the HTML page."
          },
          "content": {
            "type": [
              "string",
              "null"
            ],
            "description": "Full Markdown dossier, when one has been published for this venture and locale."
          }
        }
      },
      "VentureList": {
        "type": "object",
        "required": [
          "object",
          "count",
          "data"
        ],
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "count": {
            "type": "integer"
          },
          "locale": {
            "type": "string",
            "enum": [
              "en",
              "ja"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Venture"
            }
          }
        }
      }
    }
  }
}
