{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openaxia-com/json-schema/openaxia-com-product-summary-schema.json",
  "title": "ProductSummary",
  "x-generated": "2026-11-24",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openaxia-com-openapi.json#/components/schemas/ProductSummary",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string",
      "description": "With the server switch `MOTOBASE_PUBLIC_URLS_ENABLED` on: the canonical identifier — the last segment of the canonical page URL, `<readable>-<publicId>` (e.g. `somfy-sonesse-30-rts-k7q2m9x`); pass it to GET /api/v1/products/{slug}. A record whose publicId is not backfilled yet keeps its numeric id (its page URL is still numeric). Switch off: the legacy numeric record id (deprecated as an input)."
    },
    "name": {
      "type": "string"
    },
    "series": {
      "oneOf": [
        {
          "$ref": "#/$defs/SeriesRef"
        },
        {
          "type": "null"
        }
      ],
      "description": "The published series entity, or null when the product is not in a published series."
    },
    "manufacturer": {
      "oneOf": [
        {
          "$ref": "#/$defs/CompanyRef"
        },
        {
          "type": "null"
        }
      ]
    },
    "category": {
      "type": [
        "string",
        "null"
      ]
    },
    "categoryDisplayName": {
      "type": [
        "string",
        "null"
      ]
    },
    "activeCertificationCount": {
      "type": "integer"
    },
    "links": {
      "$ref": "#/$defs/Links"
    },
    "publicId": {
      "type": [
        "string",
        "null"
      ],
      "description": "The product's random public key (7 characters, unambiguous alphabet; stored uppercase, accepted in any case), e.g. `K7Q2M9X`. Accepted by GET /api/v1/products/{slug}. `null` until the record is backfilled."
    },
    "url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "description": "Absolute canonical page URL `/products/<readable>-<publicId>` (only the trailing publicId is authoritative). `null` until `publicId` is backfilled, and always null while the server switch `MOTOBASE_PUBLIC_URLS_ENABLED` is off. With the switch on `links.page` is the same canonical URL."
    },
    "displayName": {
      "type": "string",
      "description": "Canonical display name (the public page H1). Presentation only — never use it as an id, slug or filter value; `name` keeps the original value."
    }
  },
  "required": [
    "slug",
    "name",
    "series",
    "manufacturer",
    "category",
    "categoryDisplayName",
    "activeCertificationCount",
    "links",
    "publicId",
    "url",
    "displayName"
  ],
  "$defs": {
    "BrandRef": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "slug",
        "name"
      ]
    },
    "CompanyRef": {
      "description": "A company reference: EntityRef plus the public key and canonical page URL. `slug` follows CompanySummary.slug (company slug with the server switch `MOTOBASE_PUBLIC_URLS_ENABLED` on, else the numeric id).",
      "allOf": [
        {
          "$ref": "#/$defs/EntityRef"
        },
        {
          "type": "object",
          "properties": {
            "publicId": {
              "type": [
                "string",
                "null"
              ],
              "description": "Company slug (public key); `null` until backfilled."
            },
            "url": {
              "type": [
                "string",
                "null"
              ],
              "format": "uri",
              "description": "Absolute canonical `/companies/<slug>` URL; `null` until backfilled and while the server switch `MOTOBASE_PUBLIC_URLS_ENABLED` is off."
            }
          },
          "required": [
            "publicId",
            "url"
          ]
        }
      ]
    },
    "EntityRef": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string",
          "description": "Identifier of the referenced product or company, in the same form as ProductSummary.slug / CompanySummary.slug (canonical identifier with the server switch `MOTOBASE_PUBLIC_URLS_ENABLED` on; numeric only while that record is not backfilled)."
        },
        "name": {
          "type": "string"
        }
      },
      "required": [
        "slug",
        "name"
      ]
    },
    "Links": {
      "type": "object",
      "properties": {
        "page": {
          "type": "string",
          "format": "uri"
        },
        "api": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "page",
        "api"
      ],
      "description": "`page`: the record's public page; `api`: its API v1 detail URL. With the server switch `MOTOBASE_PUBLIC_URLS_ENABLED` on both use the canonical identifier."
    },
    "SeriesRef": {
      "type": "object",
      "description": "A published product series (motobase-product-hierarchy-and-relations).",
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "brand": {
          "$ref": "#/$defs/BrandRef"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "api": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "slug",
        "name",
        "brand",
        "url",
        "api"
      ]
    }
  }
}