{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/print-one/json-schema/print-one-validate-address-response-dto-schema.json",
  "title": "ValidateAddressResponseDto",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/print-one-address-api-openapi.yml#/components/schemas/ValidateAddressResponseDto",
  "type": "object",
  "properties": {
    "valid": {
      "type": "boolean",
      "description": "Whether the address is valid"
    },
    "address": {
      "description": "The validated address",
      "allOf": [
        {
          "$ref": "#/$defs/ValidAddressDto"
        }
      ]
    },
    "error": {
      "type": [
        "object",
        "null"
      ],
      "description": "If the address is not valid, this will contain the error message"
    }
  },
  "required": [
    "valid",
    "address",
    "error"
  ],
  "$defs": {
    "ValidAddressDto": {
      "type": "object",
      "properties": {
        "address": {
          "type": "string",
          "description": "The validated address"
        },
        "postalCode": {
          "type": "string",
          "description": "The postal code of the address"
        },
        "city": {
          "type": "string",
          "description": "The city of the address"
        },
        "country": {
          "type": "string",
          "description": "The country of the address"
        },
        "destination": {
          "type": "string",
          "description": "The calculated destination of the address",
          "enum": [
            "NETHERLANDS",
            "GERMANY",
            "INTERNATIONAL"
          ]
        }
      },
      "required": [
        "address",
        "postalCode",
        "city",
        "country",
        "destination"
      ]
    }
  }
}