# Copyright 2021 - 2025 PeopleWare n.v.
#
# 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.

type: object
examples:
  - structureVersion: 2
    discriminator: my-service/some-resource
description: >-
  The resource's search document with the most up-to-date information, i.e., up-to-date up until, but not including,
  `x-date`.


  This is a contract between this service and clients of the search service. Specific properties are added for different
  `discriminators`. When returned by the search service, the property `href` is added. This is the canonical URI of the
  found resource, including an `at` query parameter, that refers to the precise version of the found resource that was
  indexed.
properties:
  structureVersion:
    examples:
      - 2
    description: Version of the data structure of this resource type
    minimum: 1
    const: 2
  discriminator:
    type: string
    examples:
      - my-service/some-resource
    description: >-
      Type of the indexed resource.


      This enables users to search only on particular resource type. The type is qualified with the service name, to
      avoid name clashes (slash-separated).
    minLength: 1
    pattern: ^([-a-z0-9]+)\/([-a-z0-9/]+)$
required:
  - structureVersion
  - discriminator
additionalProperties: true
