# Copyright 2023 OASIS Open
#
# 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.0.1
info:
  title: LDM OSLC service API
  description: An OpenAPI specification of OSLC link discovery services
  version: “1.0”
servers:
  - url: http://localhost:8080
    description: Generated server url
paths:
  /discover-links:
    post:
      tags:
        - link-index-controller
      operationId: getResources
      parameters:
        - name: Configuration-Context
          in: header
          required: true
          schema:
            type: string
            format: uri
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              $ref: "#/components/schemas/GetIncomingLinks"
        required: true
      responses:
        "200":
          description: OK
          content:
            application/rdf+xml: null
            text/turtle: null
            application/json+ld: null
        "400":
          description: Bad request
  /rootservices:
    get:
      operationId: getCatalog
      responses:
        default:
          description: default response
          content:
            application/rdf+xml:
              schema:
                $ref: "#/components/schemas/ServiceProviderCatalog"
components:
  schemasGetIncomingLinks:
    type: object
    properties:
      objectResources:
        type: array
        items:
          type: string
      format: uri
      predicateFilters:
        type: array
        items:
          type: string
          format: uri
      pageSize:
        type: integer
        format: int32
      pageNumber:
        type: integer
        format: int32
      Publisher:
        type: object
        properties: null
      icon:
        type: string
        format: uri
      identifier:
        type: string
      label:
        type: string
      title:
        type: string
      OAuthConfiguration:
        type: object
        properties:
          authorizationURI: null
          type: string
          format: uri
      oauthAccessTokenURI:
        type: string
        format: uri
      oauthRequestTokenURI:
        type: string
        format: uri
      Service:
        type: object
        properties: null
      creationDialogs:
        type: array
        items:
          $ref: "#/components/schemas/Dialog"
      creationFactories:
        type: array
        items:
          $ref: "#/components/schemas/CreationFactory"
      queryCapabilities:
        type: array
        items:
          $ref: "#/components/schemas/QueryCapability"
      selectionDialogs:
        type: array
        items:
          $ref: "#/components/schemas/Dialog"
      usages:
        type: array
        items:
          type: string
          format: uri
      domain:
        type: string
        format: uri
      ServiceProvider: null
      type: object
      properties: null
      details:
        type: array
        items:
          type: string
          format: uri
      services:
        type: array
        items:
          $ref: "#/components/schemas/Service"
      description:
        type: string
      oauthConfiguration:
        $ref: "#/components/schemas/OAuthConfiguration"
      publisher:
        $ref: "#/components/schemas/Publisher"
      ptitle:
        type: string
    ServiceProviderCatalog:
      type: object
      properties: null
      referencedServiceProviderCatalogs:
        type: array
        items:
          type: string
          format: uri
      serviceProviders:
        type: array
        items:
          $ref: "#/components/schemas/ServiceProvider"
      description:
        type: string
      oauthConfiguration:
        $ref: "#/components/schemas/OAuthConfiguration"
      publisher:
        $ref: "#/components/schemas/Publisher"
