{
  "openapi": "3.1.0",
  "info": {
    "title": "Universal Metrology Engine – Static REST API",
    "version": "1.0.0",
    "description": "Vorgenerierte, deterministische JSON-API über 71 Größenarten, 617 Katalogeinheiten und 24 BIPM-SI-Präfixe.",
    "license": {
      "name": "CC BY 4.0",
      "url": "https://creativecommons.org/licenses/by/4.0/"
    }
  },
  "servers": [
    {
      "url": "https://mirko-werner.de"
    }
  ],
  "paths": {
    "/api/v1/index.json": {
      "get": {
        "summary": "Katalogübersicht aller 71 Größenarten und 24 SI-Präfixe",
        "operationId": "getCatalogIndex",
        "responses": {
          "200": {
            "description": "Katalog-Index",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "license",
                    "licenseUrl",
                    "recommendedQueryFormat",
                    "counts",
                    "siPrefixes",
                    "quantities",
                    "symbolToSlugs"
                  ],
                  "properties": {
                    "version": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    },
                    "licenseUrl": {
                      "type": "string"
                    },
                    "recommendedQueryFormat": {
                      "type": "string"
                    },
                    "counts": {
                      "type": "object",
                      "required": [
                        "quantities",
                        "units",
                        "siPrefixes"
                      ],
                      "properties": {
                        "quantities": {
                          "type": "integer"
                        },
                        "units": {
                          "type": "integer"
                        },
                        "siPrefixes": {
                          "type": "integer"
                        }
                      }
                    },
                    "siPrefixes": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "quantities": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "symbolToSlugs": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/groessen/{slug}.json": {
      "get": {
        "summary": "Detailkatalog einer Größenart inkl. Basiseinheit und aller zugehörigen Einheiten",
        "operationId": "getQuantityBySlug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Größenart-Dokument",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "slug",
                    "type",
                    "display",
                    "group",
                    "license",
                    "baseUnit",
                    "unitCount",
                    "units"
                  ],
                  "properties": {
                    "slug": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "display": {
                      "type": "string"
                    },
                    "group": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    },
                    "baseUnit": {
                      "type": "object"
                    },
                    "unitCount": {
                      "type": "integer"
                    },
                    "units": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden"
          }
        }
      }
    },
    "/api/v1/einheiten/{slug}.json": {
      "get": {
        "summary": "Detaildokument einer Einheit inkl. Faktoren, Formeln und Umrechnungstabelle innerhalb der Größenart",
        "operationId": "getUnitBySlug",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Einheiten-Dokument",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "slug",
                    "name",
                    "symbol",
                    "category",
                    "conversionType",
                    "exactness",
                    "siPrefixable",
                    "factor",
                    "offset",
                    "validityRange",
                    "isCalculable",
                    "displayFormulaToBase",
                    "displayFormulaFromBase",
                    "quantityType",
                    "quantityDisplay",
                    "quantitySlug",
                    "group",
                    "license",
                    "baseUnit",
                    "conversions",
                    "url"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "slug": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "symbol": {
                      "type": "string"
                    },
                    "category": {
                      "type": "string"
                    },
                    "conversionType": {
                      "type": "string"
                    },
                    "exactness": {
                      "type": "string"
                    },
                    "siPrefixable": {
                      "type": "boolean"
                    },
                    "factor": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "offset": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "validityRange": {
                      "type": "object"
                    },
                    "isCalculable": {
                      "type": "boolean"
                    },
                    "displayFormulaToBase": {
                      "type": "string"
                    },
                    "displayFormulaFromBase": {
                      "type": "string"
                    },
                    "quantityType": {
                      "type": "string"
                    },
                    "quantityDisplay": {
                      "type": "string"
                    },
                    "quantitySlug": {
                      "type": "string"
                    },
                    "group": {
                      "type": "string"
                    },
                    "license": {
                      "type": "string"
                    },
                    "baseUnit": {
                      "type": "object"
                    },
                    "conversions": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    },
                    "url": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Nicht gefunden"
          }
        }
      }
    }
  }
}