PostalCodes.info · Schema

SearchSuggestion

A lightweight lookup suggestion returned by /search. Used to power autocomplete in the PostalCodes.info UI.

Postal CodesGeocodingOpen DataAddress ValidationLogistics

Properties

Name Type Description
type string Suggestion class.
text string Primary display label.
sub string Secondary context label (typically the parent country or region).
url string Same-origin URL to the canonical lookup page for the suggestion.
View JSON Schema on GitHub

JSON Schema

postalcodes-info-search-suggestion-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/postalcodes-info/main/json-schema/postalcodes-info-search-suggestion-schema.json",
  "title": "SearchSuggestion",
  "description": "A lightweight lookup suggestion returned by /search. Used to power autocomplete in the PostalCodes.info UI.",
  "type": "object",
  "properties": {
    "type": {
      "type": "string",
      "description": "Suggestion class.",
      "enum": ["Country", "Town/City", "Postal Code", "Region"]
    },
    "text": {
      "type": "string",
      "description": "Primary display label."
    },
    "sub": {
      "type": "string",
      "description": "Secondary context label (typically the parent country or region)."
    },
    "url": {
      "type": "string",
      "description": "Same-origin URL to the canonical lookup page for the suggestion.",
      "pattern": "^/postal-codes/"
    }
  },
  "required": ["type", "text", "sub", "url"],
  "additionalProperties": false
}