# Copyright 2021 The Matrix.org Foundation C.I.C.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
openapi: 3.1.0
info:
  title: Matrix Identity Service Versions API
  version: 1.0.0
paths:
  /versions:
    get:
      x-addedInMatrixVersion: "1.1"
      summary: Gets the versions of the specification supported by the server.
      description: |-
        Gets the versions of the specification supported by the server.

        Values will take the form `vX.Y` or `rX.Y.Z` in historical cases. See
        [the Specification Versioning](../#specification-versions) for more
        information.

        All supported versions, including patch versions, are reported by the server.
      operationId: getVersions
      responses:
        "200":
          description: The versions supported by the server.
          content:
            application/json:
              schema:
                type: object
                properties:
                  versions:
                    type: array
                    description: The supported versions.
                    items:
                      type: string
                      description: The supported versions.
                required:
                  - versions
              examples:
                response:
                  value: {
                    "versions": [
                      "r0.2.0",
                      "r0.2.1",
                      "v1.1"
                    ]
                  }
servers:
  - url: "{protocol}://{hostname}{basePath}"
    variables:
      protocol:
        enum:
          - http
          - https
        default: https
      hostname:
        default: localhost:8090
      basePath:
        default: /_matrix/identity
