{
    "openapi": "3.0.0",
    "info": {
        "title": "Metadata XML API",
        "description": "Get the metadata of a single GeoResource (GeoData or GeoService) as XML, in two profiles:\n* <a href=\"https://www.ech.ch/fr/ech/ech-0271/1.1.0\" target=\"_blank\">eCH-0271</a>, the current Swiss profile (ISO 19115-1:2014, XML-encoded as ISO 19115-3:2018, plus the `che` extension)\n* GM03 (SN 612050:2005), **deprecated**\n\nBoth endpoints take the uuid of the GeoResource, whether it is a GeoData or a GeoService.\n\nPublic GeoResources are available without authentication.\nFor a restricted GeoResource, you need an authenticated user account who can view it in the catalog.\n\nSecurity recommandations for accounts :\n* Use a minimal access account for this task, who can't create or edit GeoResources.\n* Use <a href=\"/api/personal_access_token/doc\">access tokens</a> instead of username and passwords.\n* Generate an <a href=\"/api/personal_access_token/doc\">access token</a> for each application or script, for ease of revocation.\n",
        "termsOfService": "https://viageo.ch/conditions-generales",
        "contact": {
            "name": "ASIT Support",
            "url": "https://viageo.ch/#support",
            "email": "support@viageo.ch"
        },
        "version": "1.0.0"
    },
    "paths": {
        "/api/catalog/metadata/ech-0271/{uuid}.xml": {
            "get": {
                "summary": "Metadata of a GeoResource, as eCH-0271",
                "description": "Returns the metadata of a GeoData or of a GeoService, following\n<a href=\"https://www.ech.ch/fr/ech/ech-0271/1.1.0\" target=\"_blank\">eCH-0271</a>\n(ISO 19115-1:2014 encoded as ISO 19115-3:2018, plus the Swiss `che` extension).\n\nExample : /api/catalog/metadata/ech-0271/11111111-2222-3333-4444-555555555555.xml",
                "operationId": "get_catalog_api_metadata_ech0271.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "validate",
                        "in": "query",
                        "description": "Validate the generated XML against the eCH-0271 XSD. An invalid XML then returns a 500 instead of the document.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The metadata XML of the requested GeoResource"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted GeoResource"
                    },
                    "404": {
                        "description": "No published GeoResource matches this uuid"
                    },
                    "500": {
                        "description": "XML generation failed, or generated XML did not pass XSD validation when `validate` was requested"
                    }
                }
            },
            "head": {
                "summary": "Metadata of a GeoResource, as eCH-0271",
                "description": "Returns the metadata of a GeoData or of a GeoService, following\n<a href=\"https://www.ech.ch/fr/ech/ech-0271/1.1.0\" target=\"_blank\">eCH-0271</a>\n(ISO 19115-1:2014 encoded as ISO 19115-3:2018, plus the Swiss `che` extension).\n\nExample : /api/catalog/metadata/ech-0271/11111111-2222-3333-4444-555555555555.xml",
                "operationId": "head_catalog_api_metadata_ech0271.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "validate",
                        "in": "query",
                        "description": "Validate the generated XML against the eCH-0271 XSD. An invalid XML then returns a 500 instead of the document.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The metadata XML of the requested GeoResource"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted GeoResource"
                    },
                    "404": {
                        "description": "No published GeoResource matches this uuid"
                    },
                    "500": {
                        "description": "XML generation failed, or generated XML did not pass XSD validation when `validate` was requested"
                    }
                }
            }
        },
        "/api/catalog/metadata/gm03/{uuid}.xml": {
            "get": {
                "summary": "Metadata of a GeoResource, as GM03",
                "description": "Returns the metadata of a GeoData or of a GeoService, following GM03 (SN 612050:2005).\n\nExample : /api/catalog/metadata/gm03/11111111-2222-3333-4444-555555555555.xml",
                "operationId": "get_catalog_api_metadata_gm03.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "validate",
                        "in": "query",
                        "description": "Validate the generated XML against the GM03 XSD. An invalid XML then returns a 500 instead of the document.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The metadata XML of the requested GeoResource"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted GeoResource"
                    },
                    "404": {
                        "description": "No published GeoResource matches this uuid"
                    },
                    "500": {
                        "description": "XML generation failed, or generated XML did not pass XSD validation when `validate` was requested"
                    }
                },
                "deprecated": true
            },
            "head": {
                "summary": "Metadata of a GeoResource, as GM03",
                "description": "Returns the metadata of a GeoData or of a GeoService, following GM03 (SN 612050:2005).\n\nExample : /api/catalog/metadata/gm03/11111111-2222-3333-4444-555555555555.xml",
                "operationId": "head_catalog_api_metadata_gm03.fr",
                "parameters": [
                    {
                        "name": "uuid",
                        "in": "path",
                        "description": "The GeoResource GUID (uuid)",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "pattern": "[a-f0-9\\-]+"
                        }
                    },
                    {
                        "name": "validate",
                        "in": "query",
                        "description": "Validate the generated XML against the GM03 XSD. An invalid XML then returns a 500 instead of the document.",
                        "schema": {
                            "type": "boolean"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "The metadata XML of the requested GeoResource"
                    },
                    "401": {
                        "description": "Authentication information is invalid, or missing in case of a restricted GeoResource"
                    },
                    "404": {
                        "description": "No published GeoResource matches this uuid"
                    },
                    "500": {
                        "description": "XML generation failed, or generated XML did not pass XSD validation when `validate` was requested"
                    }
                },
                "deprecated": true
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "description": "Personal Access Token, you can generate one in your account",
                "name": "Personal Access Token",
                "bearerFormat": "Personal Access Token",
                "scheme": "bearer"
            },
            "basicAuth": {
                "type": "http",
                "description": "Basic Authentication with an ASIT username/email and password",
                "name": "Basic Authentication",
                "scheme": "basic"
            }
        }
    },
    "security": [
        {
            "bearer": []
        },
        {
            "basicAuth": []
        }
    ]
}