{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openconsultant.io/schemas/v0.1/schema.json",
  "title": "OpenConsultant profile",
  "description": "A consultant profile published at the source by the consulting company that offers the consultant: a JSON Resume document extended with an `openconsultant` object. Draft specification 0.1. Unknown fields are allowed and must be ignored by consumers.",
  "type": "object",
  "required": [
    "basics",
    "openconsultant"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "URL of the schema this document follows."
    },
    "basics": {
      "type": "object",
      "description": "JSON Resume `basics`: who the consultant is.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "The consultant's name as it should be presented."
        },
        "label": {
          "type": "string",
          "description": "Professional role or title, for example \"Senior Frontend Developer\"."
        },
        "summary": {
          "type": "string",
          "description": "Short profile text."
        },
        "image": {
          "type": "string",
          "description": "URL of a portrait. Publish only with the person's knowledge."
        },
        "email": {
          "type": "string",
          "format": "email",
          "description": "Contact address. Never required. Prefer `openconsultant.contact` for contact through the company."
        },
        "phone": {
          "type": "string",
          "description": "Phone number. Never required."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "A personal or professional web page."
        },
        "location": {
          "type": "object",
          "description": "Where the consultant is based, in JSON Resume form (`city`, `region`, `countryCode`)."
        }
      }
    },
    "work": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "JSON Resume `work`: professional experience."
    },
    "skills": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "JSON Resume `skills`: each with `name`, optional `level` and `keywords`."
    },
    "education": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "JSON Resume `education`."
    },
    "certificates": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "JSON Resume `certificates`."
    },
    "projects": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "JSON Resume `projects`: reference projects."
    },
    "languages": {
      "type": "array",
      "items": {
        "type": "object"
      },
      "description": "JSON Resume `languages`: each with `language` and `fluency`."
    },
    "openconsultant": {
      "type": "object",
      "description": "The OpenConsultant extension: what a buyer of consulting services needs to know beyond the resume.",
      "required": [
        "schemaVersion",
        "id",
        "canonicalUrl",
        "company",
        "availability",
        "updatedAt"
      ],
      "properties": {
        "schemaVersion": {
          "type": "string",
          "pattern": "^0\\.1\\.(0|[1-9][0-9]*)$",
          "description": "Version of OpenConsultant the profile follows, for example \"0.1.0\"."
        },
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "Stable identifier of the profile, unique within the publisher. Must never change, even if the consultant's name or the file name does. A UUID URN is recommended."
        },
        "canonicalUrl": {
          "type": "string",
          "format": "uri",
          "description": "The source address: the permanent URL of this JSON document on the company's own domain. Every service that presents the profile links back to it."
        },
        "company": {
          "$ref": "#/$defs/organization",
          "description": "The consulting company that offers the consultant and publishes the profile. The company is the source of the information."
        },
        "availability": {
          "type": "object",
          "description": "Whether the consultant can take on new work.",
          "required": [
            "status"
          ],
          "properties": {
            "status": {
              "enum": [
                "available",
                "available-from",
                "busy",
                "unknown"
              ],
              "description": "`available`: free now. `available-from`: free from the date in `availableFrom`. `busy`: not available. `unknown`: the publisher does not state availability."
            },
            "availableFrom": {
              "type": "string",
              "format": "date",
              "description": "First day the consultant is available. Required when `status` is `available-from`."
            }
          },
          "if": {
            "required": [
              "status"
            ],
            "properties": {
              "status": {
                "const": "available-from"
              }
            }
          },
          "then": {
            "required": [
              "availableFrom"
            ]
          }
        },
        "locations": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/place"
          },
          "description": "Geographic areas where the consultant can work on site."
        },
        "remote": {
          "enum": [
            "onsite",
            "hybrid",
            "remote"
          ],
          "description": "Preferred way of working. `onsite`: at the client. `hybrid`: a mix of on-site and remote. `remote`: fully remote."
        },
        "engagementTypes": {
          "type": "array",
          "items": {
            "enum": [
              "full-time",
              "part-time",
              "project"
            ]
          },
          "uniqueItems": true,
          "description": "Forms of engagement the consultant is offered for."
        },
        "contact": {
          "type": "object",
          "description": "How to enquire about the consultant, normally through the company rather than the individual.",
          "properties": {
            "name": {
              "type": "string",
              "description": "Person or function to contact."
            },
            "email": {
              "type": "string",
              "format": "email",
              "description": "Contact address at the company."
            },
            "url": {
              "type": "string",
              "format": "uri",
              "description": "Contact page or enquiry form."
            }
          }
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the profile was last changed, including changes to availability."
        },
        "htmlUrl": {
          "type": "string",
          "format": "uri",
          "description": "URL of the human readable profile page at the company showing the same information."
        }
      }
    }
  },
  "$defs": {
    "organization": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Name of the organisation."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The organisation's website."
        }
      }
    },
    "place": {
      "type": "object",
      "properties": {
        "city": {
          "type": "string",
          "description": "City or town."
        },
        "region": {
          "type": "string",
          "description": "Region, county or state."
        },
        "countryCode": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "description": "ISO 3166-1 alpha-2 country code, for example \"SE\"."
        }
      }
    }
  }
}
