{
  "openapi": "3.1.0",
  "info": {
    "title": "A Mariña Glass public service catalogue",
    "version": "1.0.0",
    "description": "Read-only information about a local workshop. No booking, availability, payments or private customer data."
  },
  "servers": [
    {
      "url": "https://amarinaglass.com"
    }
  ],
  "paths": {
    "/api/v1/services.json": {
      "get": {
        "operationId": "listServices",
        "summary": "Read the public workshop service catalogue",
        "security": [],
        "responses": {
          "200": {
            "description": "Public services and links to request information",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceCatalogue"
                }
              }
            }
          },
          "404": {
            "description": "Unknown public API endpoint",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed; catalogue is read only",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiError"
                }
              }
            }
          }
        },
        "description": "Read-only JSON catalogue. No API key required. Cache responses for one hour. For unknown API paths a JSON 404 is returned. For writes to this endpoint a JSON 405 is returned."
      }
    }
  },
  "components": {
    "schemas": {
      "ServiceCatalogue": {
        "type": "object",
        "required": ["version", "business", "services", "bookingPolicy"],
        "properties": {
          "version": {
            "type": "string"
          },
          "business": {
            "type": "object",
            "additionalProperties": false,
            "required": ["name", "url", "locality", "telephone"],
            "properties": {
              "name": {
                "type": "string"
              },
              "url": {
                "type": "string",
                "format": "uri"
              },
              "locality": {
                "type": "string"
              },
              "telephone": {
                "type": "string"
              }
            }
          },
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "name", "description", "url", "requestUrl"],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "url": {
                  "type": "string",
                  "format": "uri"
                },
                "requestUrl": {
                  "type": "string",
                  "format": "uri"
                }
              },
              "additionalProperties": false
            }
          },
          "bookingPolicy": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ApiError": {
        "type": "object",
        "required": ["error"],
        "additionalProperties": false,
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "documentation"],
            "additionalProperties": false,
            "properties": {
              "code": {
                "type": "string",
                "enum": ["not_found", "method_not_allowed"]
              },
              "message": {
                "type": "string"
              },
              "documentation": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    }
  },
  "externalDocs": {
    "url": "https://amarinaglass.com/api",
    "description": "Documentation, usage boundaries and version policy"
  }
}
