{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/emporix/main/json-schema/emporix-address-schema.json",
  "title": "Address",
  "description": "Customer address information.",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/emporix-customer-service-openapi.yml#/components/schemas/Address",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Customer address unique identifier generated when the address is added to the customer account."
    },
    "contactName": {
      "type": "string"
    },
    "companyName": {
      "type": "string"
    },
    "street": {
      "type": "string"
    },
    "streetNumber": {
      "type": "string"
    },
    "streetAppendix": {
      "type": "string"
    },
    "extraLine1": {
      "type": "string"
    },
    "extraLine2": {
      "type": "string"
    },
    "extraLine3": {
      "type": "string"
    },
    "extraLine4": {
      "type": "string"
    },
    "zipCode": {
      "type": "string"
    },
    "city": {
      "type": "string"
    },
    "country": {
      "type": "string",
      "maxLength": 2,
      "minLength": 2
    },
    "state": {
      "type": "string"
    },
    "contactPhone": {
      "type": "string"
    },
    "isDefault": {
      "type": "boolean",
      "default": false,
      "description": "Flag indicating whether the address is the customer default address."
    },
    "tags": {
      "type": "array",
      "description": "",
      "items": {
        "type": "string"
      }
    },
    "metadata": {
      "$ref": "#/$defs/DefaultDtoMetadata"
    },
    "mixins": {
      "type": "object",
      "description": "Customer address additional properties.",
      "additionalProperties": true
    }
  },
  "required": [
    "contactName"
  ],
  "$defs": {
    "BasicMetadataDto": {
      "title": "DefaultDtoMetadata",
      "type": "object",
      "properties": {
        "mixins": {
          "type": "object",
          "additionalProperties": true
        }
      },
      "description": "Links to mixin schemas."
    },
    "DefaultDtoMetadata": {
      "title": "DefaultDtoMetadata",
      "type": "object",
      "allOf": [
        {
          "$ref": "#/$defs/BasicMetadataDto"
        },
        {
          "type": "object",
          "properties": {
            "version": {
              "type": "integer"
            }
          }
        }
      ]
    }
  }
}