{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/Service/v1/schema.json",
  "title": "Service",
  "description": "Objects Grid Service Object. A service provided by an organization, e.g. delivery service, print services, etc. Modeled in compliance with https://schema.org/Service.",
  "type": "object",
  "properties": {
    "at_context": {
      "description": "Schema context",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "https://schema.org"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_type": {
      "description": "The object type",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "Service"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_id": {
      "description": "This Service's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>: its JSON-LD @id, which References point to. Set by the service.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "readOnly": true
    },
    "id": {
      "description": "The unique identifier for Service. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 50,
      "readOnly": true
    },
    "identifier": {
      "description": "The unique identifier for Service. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "maxLength": 50,
      "readOnly": true
    },
    "name": {
      "description": "The Service name",
      "type": "array",
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      },
      "minItems": 1
    },
    "alternateName": {
      "description": "An alias for the Service",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "description": {
      "description": "The Service description",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "disambiguatingDescription": {
      "description": "A short description of the Service, used to disambiguate it from other, similar Services",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "image": {
      "description": "image URL",
      "type": [
        "string",
        "null"
      ],
      "minLength": 0,
      "format": "uri"
    },
    "isRelatedTo": {
      "description": "URLs of other, somehow related Products or Services",
      "x-objectsgrid-rangeIncludes": [
        "Product",
        "ProductGroup",
        "ProductModel",
        "Service"
      ],
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
      }
    },
    "isSimilarTo": {
      "description": "URLs of other, functionally similar Products or Services",
      "x-objectsgrid-rangeIncludes": [
        "Product",
        "ProductGroup",
        "ProductModel",
        "Service"
      ],
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
      }
    },
    "logo": {
      "description": "An associated logo for the Service",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "url": {
      "description": "This Service URL. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "minLength": 1,
      "readOnly": true
    },
    "additionalType": {
      "description": "The kind of service, a Schema.org subtype of Service: its JSON-LD @type. A FinancialProduct kind (FinancialProduct, BankAccount, CurrencyConversionService, InvestmentOrDeposit, LoanOrCredit, PaymentCard, PaymentService) takes annualPercentageRate, interestRate and feesAndCommissionsSpecification; a GovernmentService serviceOperator and jurisdiction; a WebAPI documentation. None for a Service.",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "FinancialProduct",
            "BankAccount",
            "CurrencyConversionService",
            "InvestmentOrDeposit",
            "LoanOrCredit",
            "PaymentCard",
            "PaymentService",
            "FoodService",
            "GovernmentService",
            "TaxiService",
            "BroadcastService",
            "CableOrSatelliteService",
            "WebAPI"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "aggregateRating": {
      "description": "The aggregate rating of the Service",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/AggregateRating/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "areaServed": {
      "description": "The areas where the Service is provided: a name (text, e.g. 'Berlin'), a GeoCircle (a radius around a point) or a GeoShape, each with its at_type. Stored and returned, not searchable.",
      "type": [
        "array",
        "null"
      ],
      "maxItems": 50,
      "items": {
        "anyOf": [
          {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          {
            "$ref": "https://objectsgrid.com/.well-known/objects-catalog/GeoCircle/v1/schema.json"
          },
          {
            "$ref": "https://objectsgrid.com/.well-known/objects-catalog/GeoShape/v1/schema.json"
          }
        ]
      }
    },
    "audience": {
      "description": "The intended audience of the Service",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Audience/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "availableChannel": {
      "description": "URLs of the ServiceChannels for accessing the Service, e.g. a phone number, web site, or office location",
      "x-objectsgrid-rangeIncludes": [
        "ServiceChannel"
      ],
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
      }
    },
    "award": {
      "description": "Awards won by or for this Service",
      "type": [
        "string",
        "null"
      ]
    },
    "brand": {
      "description": "URL of the Brand associated with the Service",
      "x-objectsgrid-rangeIncludes": [
        "Brand",
        "Organization"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "broker": {
      "x-objectsgrid-erasure": "keep",
      "description": "URL of the Organization acting as a broker between the provider and the customer",
      "x-objectsgrid-rangeIncludes": [
        "Organization",
        "Person"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "category": {
      "description": "The categories of the Service",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "hasCertification": {
      "description": "Certifications of the Service, e.g. quality or compliance certifications",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Certification/v1/schema.json"
      }
    },
    "hasOfferCatalog": {
      "description": "URLs of the OfferCatalogs listing Offers for the Service",
      "x-objectsgrid-rangeIncludes": [
        "OfferCatalog"
      ],
      "type": [
        "array",
        "null"
      ],
      "uniqueItems": true,
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
      }
    },
    "hoursAvailable": {
      "description": "The hours during which the Service is available",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/OpeningHoursSpecification/v1/schema.json"
      }
    },
    "offers": {
      "description": "URLs of Offers to provide this Service. Computed, read-only: the objects whose Offer.itemOffered points to this object, listed from that type; never stored or written.",
      "x-objectsgrid-inverseOf": "Offer.itemOffered",
      "readOnly": true
    },
    "provider": {
      "x-objectsgrid-erasure": "keep",
      "description": "The Organization, local business (Place) or Person providing the Service",
      "x-objectsgrid-rangeIncludes": [
        "Organization",
        "Place",
        "Person"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "providerMobility": {
      "description": "Indicates the mobility of a provided Service: 'static' (the customer travels to the provider) or 'dynamic' (the provider travels to the customer)",
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "static",
        "dynamic",
        null
      ]
    },
    "review": {
      "description": "URLs of Reviews of the Service. Computed, read-only: the objects whose Review.itemReviewed points to this object, listed from that type; never stored or written.",
      "x-objectsgrid-inverseOf": "Review.itemReviewed",
      "readOnly": true
    },
    "sameAs": {
      "description": "URLs of reference Web pages that unambiguously indicate the Service's identity",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "serviceOutput": {
      "description": "What the Service produces: a Permit, such as a parking permit, or a Product",
      "x-objectsgrid-rangeIncludes": [
        "Permit",
        "Product"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "serviceType": {
      "description": "The type of Service being offered, e.g. veterans' benefits, emergency relief, etc.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "slogan": {
      "description": "A slogan or motto associated with the Service",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "tags": {
      "description": "Tags an ABAC policy can decide on. A name may repeat; the same name and value appear once. Every stored object has them: created empty when not sent, kept by a replacement (PUT) that does not mention them, unchanged by a patch that does not mention them, cleared by null or [].",
      "type": "array",
      "default": [],
      "uniqueItems": true,
      "maxItems": 50,
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Tag/v1/schema.json"
      }
    },
    "termsOfService": {
      "description": "URL of the terms of service of the Service",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "annualPercentageRate": {
      "description": "FinancialProduct: the annual percentage rate",
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "interestRate": {
      "description": "FinancialProduct: the interest rate, in percent",
      "type": [
        "number",
        "null"
      ],
      "minimum": 0
    },
    "feesAndCommissionsSpecification": {
      "description": "FinancialProduct: the fees and commissions, as text or a URL",
      "type": [
        "string",
        "null"
      ]
    },
    "serviceOperator": {
      "description": "GovernmentService: the operator of the service, when it is not the provider",
      "x-objectsgrid-rangeIncludes": [
        "Organization"
      ],
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "jurisdiction": {
      "description": "GovernmentService: the area whose rules apply, e.g. 'Berlin'",
      "type": [
        "string",
        "null"
      ]
    },
    "documentation": {
      "description": "WebAPI: its documentation",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "meta": {
      "description": "System-managed metadata for the object (version, audit fields). Assigned by the server.",
      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ObjectMeta/v1/schema.json",
      "readOnly": true
    }
  },
  "required": [
    "name"
  ],
  "unevaluatedProperties": false,
  "allOf": [
    {
      "if": {
        "required": [
          "additionalType"
        ],
        "properties": {
          "additionalType": {
            "enum": [
              "FinancialProduct",
              "BankAccount",
              "CurrencyConversionService",
              "InvestmentOrDeposit",
              "LoanOrCredit",
              "PaymentCard",
              "PaymentService"
            ]
          }
        }
      },
      "else": {
        "not": {
          "anyOf": [
            {
              "required": [
                "annualPercentageRate"
              ]
            },
            {
              "required": [
                "interestRate"
              ]
            },
            {
              "required": [
                "feesAndCommissionsSpecification"
              ]
            }
          ]
        }
      }
    },
    {
      "if": {
        "required": [
          "additionalType"
        ],
        "properties": {
          "additionalType": {
            "enum": [
              "GovernmentService"
            ]
          }
        }
      },
      "else": {
        "not": {
          "anyOf": [
            {
              "required": [
                "serviceOperator"
              ]
            },
            {
              "required": [
                "jurisdiction"
              ]
            }
          ]
        }
      }
    },
    {
      "if": {
        "required": [
          "additionalType"
        ],
        "properties": {
          "additionalType": {
            "enum": [
              "WebAPI"
            ]
          }
        }
      },
      "else": {
        "not": {
          "anyOf": [
            {
              "required": [
                "documentation"
              ]
            }
          ]
        }
      }
    }
  ]
}
