{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-market-local/0.2"
        },
        "job_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]+$"
            }
          ]
        },
        "round_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]+$"
            }
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "OPEN",
            "CLOSED"
          ]
        },
        "deadline": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:Z))$"
        },
        "candidate_slots": {
          "type": "number",
          "const": 2
        },
        "reward": {
          "type": "object",
          "properties": {
            "unit": {
              "type": "string",
              "const": "TEST_CREDIT"
            },
            "amount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            },
            "redeemable": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "unit",
            "amount",
            "redeemable"
          ],
          "additionalProperties": false,
          "description": "Fictional, non-redeemable credits. No currency, funds, wallet, fees or payment processor."
        },
        "output_contract": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "media_type": {
                  "type": "string",
                  "const": "text/plain"
                },
                "max_bytes": {
                  "type": "number",
                  "const": 4096
                },
                "schema_id": {
                  "type": "null"
                }
              },
              "required": [
                "media_type",
                "max_bytes",
                "schema_id"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "media_type": {
                  "type": "string",
                  "const": "text/markdown"
                },
                "max_bytes": {
                  "type": "number",
                  "const": 4096
                },
                "schema_id": {
                  "type": "null"
                }
              },
              "required": [
                "media_type",
                "max_bytes",
                "schema_id"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "media_type": {
                  "type": "string",
                  "const": "application/json"
                },
                "max_bytes": {
                  "type": "number",
                  "const": 4096
                },
                "schema_id": {
                  "type": "string",
                  "const": "GardenFacts"
                }
              },
              "required": [
                "media_type",
                "max_bytes",
                "schema_id"
              ],
              "additionalProperties": false
            }
          ]
        },
        "capability": {
          "type": "string",
          "const": "writing/brief"
        },
        "input": {
          "type": "object",
          "properties": {
            "title": {
              "type": "string",
              "const": "Elm Garden"
            },
            "opening_day": {
              "type": "string",
              "const": "Saturday"
            },
            "activity": {
              "type": "string",
              "const": "planting workshop"
            },
            "instruction": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "required": [
            "title",
            "opening_day",
            "activity",
            "instruction"
          ],
          "additionalProperties": false
        },
        "selection_policy": {
          "type": "string",
          "const": "most-facts-first-submission-v1"
        }
      },
      "required": [
        "profile",
        "job_id",
        "round_id",
        "state",
        "deadline",
        "candidate_slots",
        "reward",
        "output_contract",
        "capability",
        "input",
        "selection_policy"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "profile": {
          "type": "string",
          "const": "owp-market-local/0.2"
        },
        "job_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]+$"
            }
          ]
        },
        "round_id": {
          "type": "string",
          "allOf": [
            {
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            {
              "pattern": "^[a-f0-9-]+$"
            }
          ]
        },
        "state": {
          "type": "string",
          "enum": [
            "OPEN",
            "CLOSED"
          ]
        },
        "deadline": {
          "type": "string",
          "format": "date-time",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:Z))$"
        },
        "candidate_slots": {
          "type": "number",
          "const": 2
        },
        "reward": {
          "type": "object",
          "properties": {
            "unit": {
              "type": "string",
              "const": "TEST_CREDIT"
            },
            "amount": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            },
            "redeemable": {
              "type": "boolean",
              "const": false
            }
          },
          "required": [
            "unit",
            "amount",
            "redeemable"
          ],
          "additionalProperties": false,
          "description": "Fictional, non-redeemable credits. No currency, funds, wallet, fees or payment processor."
        },
        "output_contract": {
          "oneOf": [
            {
              "type": "object",
              "properties": {
                "media_type": {
                  "type": "string",
                  "const": "text/plain"
                },
                "max_bytes": {
                  "type": "number",
                  "const": 4096
                },
                "schema_id": {
                  "type": "null"
                }
              },
              "required": [
                "media_type",
                "max_bytes",
                "schema_id"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "media_type": {
                  "type": "string",
                  "const": "text/markdown"
                },
                "max_bytes": {
                  "type": "number",
                  "const": 4096
                },
                "schema_id": {
                  "type": "null"
                }
              },
              "required": [
                "media_type",
                "max_bytes",
                "schema_id"
              ],
              "additionalProperties": false
            },
            {
              "type": "object",
              "properties": {
                "media_type": {
                  "type": "string",
                  "const": "application/json"
                },
                "max_bytes": {
                  "type": "number",
                  "const": 4096
                },
                "schema_id": {
                  "type": "string",
                  "const": "WeatherFacts"
                }
              },
              "required": [
                "media_type",
                "max_bytes",
                "schema_id"
              ],
              "additionalProperties": false
            }
          ]
        },
        "capability": {
          "type": "string",
          "const": "weather/current"
        },
        "audience": {
          "type": "string",
          "const": "private"
        },
        "input": {
          "type": "object",
          "properties": {
            "instruction": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "required": [
            "instruction"
          ],
          "additionalProperties": false
        },
        "context_requirements": {
          "type": "array",
          "prefixItems": [
            {
              "type": "string",
              "const": "location.current"
            }
          ]
        },
        "selection_policy": {
          "type": "string",
          "const": "weather-facts-first-submission-v1"
        }
      },
      "required": [
        "profile",
        "job_id",
        "round_id",
        "state",
        "deadline",
        "candidate_slots",
        "reward",
        "output_contract",
        "capability",
        "audience",
        "input",
        "context_requirements",
        "selection_policy"
      ],
      "additionalProperties": false
    }
  ],
  "description": "Weather previews contain no location. Use the encrypted, job-bound context channel. Only the job owner can read selected weather content.",
  "title": "Job",
  "$comment": "owp-market-local/0.2; fictional loopback market, non-redeemable test credits only."
}
