{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dealermax-app/json-schema/dealermax-app-dealer-public-content-search-response-schema.json",
  "title": "DealerPublicContentSearchResponse",
  "description": "Cross-content-type search results for the dealer.",
  "x-generated": "2026-11-05",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dealermax-app-openapi.json#/components/schemas/DealerPublicContentSearchResponse",
  "type": "object",
  "required": [
    "q",
    "page_size_per_type",
    "total",
    "by_type",
    "items"
  ],
  "properties": {
    "q": {
      "type": "string",
      "description": "Free-text query that produced these results."
    },
    "page_size_per_type": {
      "type": "integer",
      "minimum": 1,
      "maximum": 20,
      "description": "Maximum number of results returned per content type."
    },
    "total": {
      "type": "integer",
      "minimum": 0,
      "description": "Total number of matching items across all content types."
    },
    "by_type": {
      "type": "object",
      "description": "Per-content-type match counts, keyed by content type name.",
      "additionalProperties": {
        "type": "integer",
        "minimum": 0
      }
    },
    "items": {
      "type": "array",
      "description": "Matching content items, interleaved across content types.",
      "items": {
        "$ref": "#/$defs/DealerPublicContentItem"
      }
    },
    "meta": {
      "type": "object",
      "additionalProperties": true,
      "description": "Identifying metadata about the dealer that owns the returned content.",
      "properties": {
        "dealer": {
          "type": "object",
          "additionalProperties": true,
          "description": "The dealer the content belongs to.",
          "properties": {
            "id": {
              "type": "integer",
              "description": "Internal dealer id."
            },
            "name": {
              "type": "string",
              "description": "Dealer legal/registered name."
            },
            "brand_name": {
              "type": "string",
              "description": "Dealer commercial brand name, as shown to end users."
            },
            "city": {
              "type": "string",
              "description": "Dealer city."
            },
            "province": {
              "type": "string",
              "description": "Dealer province (Italian two-letter code, e.g. 'MI')."
            },
            "primary_domain": {
              "type": "string",
              "description": "Dealer primary public website domain."
            }
          }
        }
      }
    }
  },
  "$defs": {
    "DealerPublicContentItem": {
      "type": "object",
      "additionalProperties": true,
      "description": "One editorial content item (news, guide, glossary term or FAQ) published on the dealer site.",
      "properties": {
        "id": {
          "type": "integer",
          "description": "Internal content item id."
        },
        "slug": {
          "type": "string",
          "description": "URL-friendly unique slug identifying the content item."
        },
        "topic": {
          "type": "string",
          "description": "Topic / category the content item belongs to."
        },
        "title": {
          "type": "string",
          "description": "Content title."
        },
        "h1": {
          "type": "string",
          "description": "Page H1 heading (may differ from the title)."
        },
        "meta_description": {
          "type": "string",
          "description": "SEO meta description for the content page."
        },
        "excerpt": {
          "type": "string",
          "description": "Short summary/teaser of the content."
        },
        "body_text_preview": {
          "type": "string",
          "description": "Plain-text preview of the body (truncated; full body served on the dealer site)."
        },
        "source_provider": {
          "type": "string",
          "description": "News editions only: provenance class. dealer_editorial identifies first-party local editions; historical/external editions remain readable but are excluded from discovery."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "Absolute URL of the content page on the dealer site."
        },
        "updated_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of the last content update (ISO 8601)."
        }
      }
    }
  }
}