{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/buckybuild-com/json-schema/buckybuild-com-market-list-response-schema.json",
  "title": "MarketListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/buckybuild-com-marketplace-api-openapi.yml#/components/schemas/MarketListResponse",
  "type": "object",
  "required": [
    "data",
    "meta",
    "error"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": true
      }
    },
    "meta": {
      "$ref": "#/$defs/MarketMeta"
    },
    "error": {
      "nullable": true,
      "description": "`null` on success.",
      "oneOf": [
        {
          "$ref": "#/$defs/ErrorResponse"
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "$defs": {
    "ErrorResponse": {
      "type": "object",
      "title": "ErrorResponse",
      "required": [
        "error",
        "code",
        "category",
        "status",
        "retryable",
        "requestId",
        "supportId"
      ],
      "properties": {
        "error": {
          "type": "string",
          "description": "Human readable error message."
        },
        "code": {
          "type": "string",
          "description": "Stable machine readable error code. Match on this, never on the message text."
        },
        "category": {
          "type": "string",
          "description": "Coarse class of failure, for routing and metrics.",
          "enum": [
            "AUTHENTICATION",
            "AUTHORIZATION",
            "VALIDATION",
            "NOT_FOUND",
            "RATE_LIMIT",
            "CONFLICT",
            "NETWORK",
            "SERVER",
            "UNKNOWN"
          ]
        },
        "status": {
          "type": "integer",
          "description": "HTTP status, repeated in the body for transport-agnostic clients."
        },
        "retryable": {
          "type": "boolean",
          "description": "Whether retrying the identical request can succeed. `false` means fix the request; do not back off and retry."
        },
        "userMessageKey": {
          "type": "string",
          "description": "i18n key for a message safe to show an end user."
        },
        "supportId": {
          "type": "string",
          "description": "Short reference to quote to support, e.g. `SUP-B1F8ACF9`."
        },
        "requestId": {
          "type": "string",
          "minLength": 1,
          "description": "Correlates this response with our server logs."
        },
        "details": {
          "description": "Optional structured error details.",
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "object",
              "additionalProperties": true
            },
            {
              "type": "array",
              "items": {}
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "MarketMeta": {
      "type": "object",
      "required": [
        "pagination"
      ],
      "properties": {
        "pagination": {
          "$ref": "#/$defs/MarketPagination"
        },
        "filters": {
          "type": "object",
          "additionalProperties": true,
          "description": "Normalised echo of the filters applied to this request."
        },
        "timing": {
          "type": "object",
          "properties": {
            "durationMs": {
              "type": "integer"
            },
            "cached": {
              "type": "boolean"
            }
          }
        },
        "userContext": {
          "type": "object",
          "description": "Present only for authenticated callers.",
          "properties": {
            "favorites": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "projectItems": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "MarketPagination": {
      "type": "object",
      "required": [
        "cursor",
        "hasMore"
      ],
      "properties": {
        "cursor": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque cursor for the next page. `null` when there is no further page. Pass back as the `cursor` query param."
        },
        "hasMore": {
          "type": "boolean",
          "description": "Whether a further page exists."
        },
        "limit": {
          "type": "integer",
          "description": "Page size actually applied."
        },
        "totalCount": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Total matching rows. Authoritative field — prefer this."
        },
        "total": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Deprecated duplicate of `totalCount`, kept for compatibility.",
          "deprecated": true
        },
        "mode": {
          "type": "string",
          "enum": [
            "cursor"
          ],
          "description": "Pagination strategy. Offset paging returns `PAGE_DEPRECATED`."
        }
      }
    }
  }
}