SHAR Production
← All contracts

JSON Schema 2020-12

Vendor Bid Comparison

Pseudonymous bids with currency, total and scope score.

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sharprod.com/schemas/vendor-bid-comparison.schema.json",
  "title": "SHAR Production Vendor Bid Comparison Contract",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "currency": {
      "type": "string",
      "pattern": "^[A-Z]{3}$"
    },
    "bids": {
      "type": "array",
      "minItems": 2,
      "items": {
        "type": "object",
        "required": [
          "vendor_ref",
          "total",
          "scope_score"
        ],
        "properties": {
          "vendor_ref": {
            "type": "string",
            "pattern": "^vendor-[a-z0-9-]+$"
          },
          "total": {
            "type": "number",
            "minimum": 0
          },
          "scope_score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          }
        }
      }
    }
  },
  "required": [
    "currency",
    "bids"
  ]
}

Verified example

{
  "input": {
    "currency": "RUB",
    "bids": [
      {
        "vendor_ref": "vendor-alpha",
        "total": 100000,
        "scope_score": 82
      },
      {
        "vendor_ref": "vendor-beta",
        "total": 120000,
        "scope_score": 91
      }
    ]
  },
  "result": {
    "valid": true,
    "errors": []
  }
}

Rejected example

{
  "input": {
    "currency": "rub",
    "bids": [
      {
        "vendor_ref": "Real Company",
        "total": -1,
        "scope_score": 101
      }
    ]
  },
  "result": {
    "valid": false,
    "errors": [
      {
        "instancePath": "/currency",
        "schemaPath": "#/properties/currency/pattern",
        "keyword": "pattern",
        "params": {
          "pattern": "^[A-Z]{3}$"
        },
        "message": "must match pattern \"^[A-Z]{3}$\""
      }
    ]
  }
}

SHAR Production · sharprod.com