#  Copyright (c) 2026 Cisco Systems, Inc. and its affiliates
#  SPDX-License-Identifier: Apache-2.0
$schema: "https://json-schema.org/draft-07/schema#"
title: OverlayFlavourPatch
# Structural (type-shape) validation ONLY for `mas-ctl validate <overlay.yaml>`.
# Merge BEHAVIOR is no longer read from this file -- ctl/src/mas/ctl/overlay/
# merge.py reads x-merge annotations straight off ../flavour.schema.yaml's
# own spec properties (single source of truth). Same pattern as
# overlay-agent-patch.schema.yaml -- see that file's header comment.
type: object
additionalProperties: false
patternProperties:
  "^x-": {}
properties:
  agent_comm:
    $ref: "../flavour.schema.yaml#/properties/spec/properties/agent_comm"
  capabilities:
    $ref: "../flavour.schema.yaml#/properties/spec/properties/capabilities"
  telemetry:
    $ref: "../flavour.schema.yaml#/properties/spec/properties/telemetry"
  observability:
    # Not a plain $ref: overlay context accepts the {"$op": {...}}
    # plugin-list sugar, unlike the base schema's plain plugin-list shape --
    # a genuine difference, not duplication.
    x-merge:
      strategy: plugin_list_ops
      identity: plugin_id
    oneOf:
      - type: "null"
      - $ref: "./overlay-collection-ops-observability.schema.yaml"
  control:
    x-merge:
      strategy: mapping_ops
    oneOf:
      - type: "null"
      - $ref: "./overlay-collection-ops-control.schema.yaml"
  tools:
    # Not a plain $ref: overlay context accepts {"$op": {replace|merge|clear}}
    # alongside a plain object, unlike the base schema's plain object.
    $ref: "./overlay-collection-ops-object-merge.schema.yaml"
  config:
    $ref: "./overlay-collection-ops-object-merge.schema.yaml"
  operator:
    $ref: "./overlay-collection-ops-object-merge.schema.yaml"
