Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
SethFalco opened this issue Aug 7, 2021 · 0 comments · May be fixed by #440
Open

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

SethFalco opened this issue Aug 7, 2021 · 0 comments · May be fixed by #440

Comments

@SethFalco
Copy link
Member

SethFalco commented Aug 7, 2021

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?

@SethFalco SethFalco changed the title basics.location.address should be a string[] basics.location.address should be a string[]? Aug 7, 2021
@SethFalco SethFalco linked a pull request May 15, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant