{
  "openapi": "3.1.0",
  "info": {
    "title": "Open knowledge Romania catalogue API",
    "version": "1.1.0",
    "description": "Read-only editorial metadata, not provider datasets. Original metadata CC BY 4.0; upstream rights remain separate."
  },
  "servers": [
    {
      "url": "https://mariuscomper.uk/cunoastere-deschisa"
    }
  ],
  "paths": {
    "/api/resources": {
      "get": {
        "summary": "Search catalogue records",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "topic",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "health",
                "living",
                "economy",
                "justice",
                "education",
                "population",
                "environment",
                "transport",
                "spending",
                "geography",
                "research",
                "language",
                "heritage",
                "legislation",
                "standards",
                "elections"
              ]
            }
          },
          {
            "name": "collection",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "data",
                "documents",
                "research",
                "heritage"
              ]
            }
          },
          {
            "name": "type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "catalog",
                "database",
                "dataset",
                "archive",
                "standard",
                "api",
                "corpus",
                "document"
              ]
            }
          },
          {
            "name": "rights",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "explicit",
                "varies",
                "restricted",
                "unknown"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "verified-direct",
                "official-link-unverified"
              ]
            }
          },
          {
            "name": "api",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "true"
              ]
            }
          },
          {
            "name": "access",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "browser",
                "download",
                "api"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching page; CSV uses identical pagination.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "total",
                    "resources",
                    "next"
                  ],
                  "properties": {
                    "total": {
                      "type": "integer"
                    },
                    "returned": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "next": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "resources": {
                      "type": "array",
                      "items": {
                        "$ref": "https://mariuscomper.uk/cunoastere-deschisa/catalog.schema.json#/$defs/resource"
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query"
          }
        }
      }
    },
    "/api/resources/{id}": {
      "get": {
        "summary": "One catalogue record",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Record",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "https://mariuscomper.uk/cunoastere-deschisa/catalog.schema.json#/$defs/resource"
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    },
    "/api/resources/{id}/related": {
      "get": {
        "summary": "Editorial suggestions",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Editorial suggestions with full records",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "resources": {
                      "type": "array",
                      "items": {
                        "$ref": "https://mariuscomper.uk/cunoastere-deschisa/catalog.schema.json#/$defs/resource"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Record not found"
          }
        }
      }
    }
  }
}