{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/saasrfp-com/json-schema/saasrfp-com-product-schema.json",
  "title": "Product",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/saasrfp-com-openapi.json#/components/schemas/Product",
  "allOf": [
    {
      "$ref": "#/$defs/ProductSummary"
    },
    {
      "type": "object",
      "properties": {
        "description": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "demoUrl": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "docsUrl": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "pricingUrl": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "pricingNote": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "bids": {
          "type": "array",
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/BidSummary"
              },
              {
                "type": "object",
                "properties": {
                  "rfp": {
                    "type": "object",
                    "properties": {
                      "slug": {
                        "type": "string"
                      },
                      "title": {
                        "type": "string"
                      },
                      "vendorName": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "slug",
                      "title",
                      "vendorName"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "rfp"
                ],
                "additionalProperties": false
              }
            ]
          }
        }
      },
      "required": [
        "description",
        "demoUrl",
        "docsUrl",
        "pricingUrl",
        "pricingNote",
        "bids"
      ],
      "additionalProperties": false
    }
  ],
  "$defs": {
    "BidSummary": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "submitted",
            "shortlisted",
            "rejected",
            "accepted"
          ]
        },
        "product": {
          "type": "object",
          "properties": {
            "slug": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": [
            "slug",
            "name"
          ],
          "additionalProperties": false
        },
        "annualPrice": {
          "type": "number",
          "description": "Whole US dollars per year."
        },
        "savingsPercent": {
          "type": "number",
          "description": "Percent saved against the RFP's annual spend. Negative when the bid costs more."
        },
        "matchPercent": {
          "type": "number"
        },
        "seller": {
          "$ref": "#/$defs/Party"
        },
        "createdAt": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "status",
        "product",
        "annualPrice",
        "savingsPercent",
        "matchPercent",
        "seller",
        "createdAt",
        "url"
      ],
      "additionalProperties": false
    },
    "Party": {
      "type": "object",
      "properties": {
        "anonymous": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "handle": {
          "oneOf": [
            {
              "type": "string",
              "description": "Null when the party is anonymous to this caller."
            },
            {
              "type": "null"
            }
          ]
        },
        "company": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "url": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "anonymous",
        "name",
        "handle",
        "company",
        "url"
      ],
      "additionalProperties": false
    },
    "ProductSummary": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "tagline": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "website": {
          "type": "string"
        },
        "pricingModel": {
          "type": "string",
          "enum": [
            "subscription",
            "per-seat",
            "usage",
            "one-time",
            "free",
            "custom"
          ]
        },
        "bidCount": {
          "type": "integer"
        },
        "seller": {
          "$ref": "#/$defs/Party"
        },
        "url": {
          "type": "string"
        }
      },
      "required": [
        "slug",
        "name",
        "tagline",
        "website",
        "pricingModel",
        "bidCount",
        "seller",
        "url"
      ],
      "additionalProperties": false
    }
  }
}