{
  "$id": "https://namespace.lantmateriet.se/distribution/produkter/uppslag/fastighetsnyckel/v1/uppslag-fastighetsnyckel-1.0.2.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Objektidentitet Uppslag Fastighetsnyckel",
  "oneOf": [
    {
      "$ref": "#/$defs/request"
    },
    {
      "$ref": "#/$defs/response"
    }
  ],
  "$defs": {
    "request": {
      "oneOf": [
        {
          "$ref": "#/$defs/idRequest"
        }
      ]
    },
    "response": {
      "oneOf": [
        {
          "$ref": "#/$defs/idResponse"
        },
        {
          "$ref": "#/$defs/healthResponse"
        },
        {
          "$ref": "https://namespace.lantmateriet.se/distribution/produkter/fault/v1/fault-1.1.json"
        }
      ]
    },
    "idRequest": {
      "type": "array",
      "oneOf": [
        {
          "items": {
            "$ref": "#/$defs/fastighetsnyckel"
          }
        },
        {
          "items": {
            "type": "string",
            "format": "uuid"
          }
        }
      ],
      "minItems": 1
    },
    "idResponse": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/id"
      }
    },
    "id": {
      "type": "object",
      "properties": {
        "fastighetsnyckel": {
          "$ref": "#/$defs/fastighetsnyckel"
        },
        "objektidentitet": {
          "type": "string",
          "format": "uuid"
        }
      },
      "required": [
        "fastighetsnyckel",
        "objektidentitet"
      ],
      "additionalProperties": false
    },
    "healthResponse": {
      "type": "object",
      "properties": {
        "up": {
          "type": "boolean"
        }
      },
      "required": [
        "up"
      ],
      "additionalProperties": false
    },
    "fastighetsnyckel": {
      "type": "string",
      "pattern": "^[0-9]{9}$"
    }
  }
}