Skip to content

basics.location.address should be a string[]? #423

@SethFalco

Description

@SethFalco

Currently, basics.location.address is a string, and it's documented that users should use \n to insert line breaks.
I think it'd be better to allow users to define the address lines separately with a string[]. (string can still be permissible)

The change would be backward compatible, theme templates would just have to check if it's an array or a string literal.

{
  "basics": {
    "location": {
      "address": "International House\n24 Holborn Viaduct\nLondon, EC1A 2BN"
    }
  }
}
{
  "basics": {
    "location": {
      "address": [
        "International House",
        "24 Holborn Viaduct",
        "London, EC1A 2BN"
      ]
    }
  }
}

The change in the schema would probably look like the following, and again, would be backward compatible.

{
  "title": "Address",
  "description": "Your physical address.",
  "oneOf": [
    {
      "type": "array",
      "description": "The address lines for your physical address.",
      "items": {
        "type": "string",
        "description": "A single line from the physical address."
      }
    },
    {
      "type": "string",
      "description": "To add multiple address lines, use \n. For example, 1234 Glücklichkeit Straße\nHinterhaus 5. Etage li."
    }
  ]
}

Alternatively, we could also just deprecate the old way of doing it as well?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions