{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/traydstar-com/json-schema/traydstar-com-listing-schema.json",
  "title": "Listing",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/traydstar-com-openapi.json#/components/schemas/Listing",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "title": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "type": {
      "type": "string",
      "enum": [
        "GOOD",
        "SERVICE",
        "BOTH"
      ]
    },
    "category": {
      "type": "string"
    },
    "subcategory": {
      "type": [
        "string",
        "null"
      ]
    },
    "condition": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "NEW",
        "LIKE_NEW",
        "GOOD",
        "FAIR",
        "POOR",
        null
      ]
    },
    "images": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "want_tags": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "want_description": {
      "type": [
        "string",
        "null"
      ]
    },
    "estimated_value_usd": {
      "type": [
        "number",
        "null"
      ]
    },
    "location_city": {
      "type": [
        "string",
        "null"
      ]
    },
    "listed_by_agent": {
      "type": "boolean"
    },
    "is_example": {
      "type": "boolean",
      "description": "A labelled demo listing, not real supply."
    },
    "kind": {
      "type": "string",
      "enum": [
        "offer",
        "wanted"
      ]
    },
    "pickup": {
      "type": "boolean"
    },
    "ships": {
      "type": "boolean"
    },
    "view_count": {
      "type": "number"
    },
    "status": {
      "type": "string",
      "description": "Detail only: ACTIVE, PAUSED, DRAFT, TRADED or REMOVED."
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "user": {
      "$ref": "#/$defs/ListingOwner"
    }
  },
  "required": [
    "id",
    "title",
    "type",
    "category",
    "kind",
    "created_at"
  ],
  "$defs": {
    "ListingOwner": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "display_name": {
          "type": "string"
        },
        "rating_avg": {
          "type": "number"
        },
        "trayd_count": {
          "type": "number"
        },
        "city": {
          "type": [
            "string",
            "null"
          ]
        },
        "state_region": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    }
  }
}