Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion specification/parameters/path-country_code.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"description": "Country code in ISO 3166-1 alpha-2 format.",
"required": true,
"schema": {
"$ref": "#/components/schemas/CountryCode"
"$ref": "#/components/schemas/CountryCodeUserInput"
}
}
3 changes: 3 additions & 0 deletions specification/schemas.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@
"CountryCode": {
"$ref": "./schemas/addresses/CountryCode.json"
},
"CountryCodeUserInput": {
"$ref": "./schemas/addresses/CountryCodeUserInput.json"
},
"Currency": {
"$ref": "./schemas/Currency.json"
},
Expand Down
28 changes: 27 additions & 1 deletion specification/schemas/addresses/CountryCode.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
{
"type": "string",
"pattern": "^(AD|AE|AF|AG|AI|AL|AM|AO|AQ|AR|AS|AT|AU|AW|AX|AZ|BA|BB|BD|BE|BF|BG|BH|BI|BJ|BL|BM|BN|BO|BQ|BR|BS|BT|BV|BW|BY|BZ|CA|CC|CD|CF|CG|CH|CI|CK|CL|CM|CN|CO|CR|CU|CV|CW|CX|CY|CZ|DE|DJ|DK|DM|DO|DZ|EC|EE|EG|EH|ER|ES|ET|FI|FJ|FK|FM|FO|FR|GA|GB|GD|GE|GF|GG|GH|GI|GL|GM|GN|GP|GQ|GR|GS|GT|GU|GW|GY|HK|HM|HN|HR|HT|HU|ID|IE|IL|IM|IN|IO|IQ|IR|IS|IT|JE|JM|JO|JP|KE|KG|KH|KI|KM|KN|KP|KR|KW|KY|KZ|LA|LB|LC|LI|LK|LR|LS|LT|LU|LV|LY|MA|MC|MD|ME|MF|MG|MH|MK|ML|MM|MN|MO|MP|MQ|MR|MS|MT|MU|MV|MW|MX|MY|MZ|NA|NC|NE|NF|NG|NI|NL|NO|NP|NR|NU|NZ|OM|PA|PE|PF|PG|PH|PK|PL|PM|PN|PR|PS|PT|PW|PY|QA|RE|RO|RS|RU|RW|SA|SB|SC|SD|SE|SG|SH|SI|SJ|SK|SL|SM|SN|SO|SR|SS|ST|SV|SX|SY|SZ|TC|TD|TF|TG|TH|TJ|TK|TL|TM|TN|TO|TR|TT|TV|TW|TZ|UA|UG|UM|US|UY|UZ|VA|VC|VE|VG|VI|VN|VU|WF|WS|XK|YE|YT|ZA|ZM|ZW)$",
"enum": [
"AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR",
"AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE",
"BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ",
"BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD",
"CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR",
"CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM",
"DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI",
"FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF",
"GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS",
"GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU",
"ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT",
"JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN",
"KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK",
"LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME",
"MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ",
"MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA",
"NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU",
"NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM",
"PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS",
"RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI",
"SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV",
"SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK",
"TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA",
"UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI",
"VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW"
],
"example": "GB",
"description": "Country code in ISO 3166-1 alpha-2 format."
}
57 changes: 57 additions & 0 deletions specification/schemas/addresses/CountryCodeUserInput.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"type": "string",
"enum": [
"AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR",
"AS", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE",
"BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ",
"BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CC", "CD",
"CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR",
"CU", "CV", "CW", "CX", "CY", "CZ", "DE", "DJ", "DK", "DM",
"DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI",
"FJ", "FK", "FM", "FO", "FR", "GA", "GB", "GD", "GE", "GF",
"GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS",
"GT", "GU", "GW", "GY", "HK", "HM", "HN", "HR", "HT", "HU",
"ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IR", "IS", "IT",
"JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN",
"KP", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK",
"LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME",
"MF", "MG", "MH", "MK", "ML", "MM", "MN", "MO", "MP", "MQ",
"MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA",
"NC", "NE", "NF", "NG", "NI", "NL", "NO", "NP", "NR", "NU",
"NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM",
"PN", "PR", "PS", "PT", "PW", "PY", "QA", "RE", "RO", "RS",
"RU", "RW", "SA", "SB", "SC", "SD", "SE", "SG", "SH", "SI",
"SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV",
"SX", "SY", "SZ", "TC", "TD", "TF", "TG", "TH", "TJ", "TK",
"TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA",
"UG", "UM", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VI",
"VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW",
"ad", "ae", "af", "ag", "ai", "al", "am", "ao", "aq", "ar",
"as", "at", "au", "aw", "ax", "az", "ba", "bb", "bd", "be",
"bf", "bg", "bh", "bi", "bj", "bl", "bm", "bn", "bo", "bq",
"br", "bs", "bt", "bv", "bw", "by", "bz", "ca", "cc", "cd",
"cf", "cg", "ch", "ci", "ck", "cl", "cm", "cn", "co", "cr",
"cu", "cv", "cw", "cx", "cy", "cz", "de", "dj", "dk", "dm",
"do", "dz", "ec", "ee", "eg", "eh", "er", "es", "et", "fi",
"fj", "fk", "fm", "fo", "fr", "ga", "gb", "gd", "ge", "gf",
"gg", "gh", "gi", "gl", "gm", "gn", "gp", "gq", "gr", "gs",
"gt", "gu", "gw", "gy", "hk", "hm", "hn", "hr", "ht", "hu",
"id", "ie", "il", "im", "in", "io", "iq", "ir", "is", "it",
"je", "jm", "jo", "jp", "ke", "kg", "kh", "ki", "km", "kn",
"kp", "kr", "kw", "ky", "kz", "la", "lb", "lc", "li", "lk",
"lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
"mf", "mg", "mh", "mk", "ml", "mm", "mn", "mo", "mp", "mq",
"mr", "ms", "mt", "mu", "mv", "mw", "mx", "my", "mz", "na",
"nc", "ne", "nf", "ng", "ni", "nl", "no", "np", "nr", "nu",
"nz", "om", "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pm",
"pn", "pr", "ps", "pt", "pw", "py", "qa", "re", "ro", "rs",
"ru", "rw", "sa", "sb", "sc", "sd", "se", "sg", "sh", "si",
"sj", "sk", "sl", "sm", "sn", "so", "sr", "ss", "st", "sv",
"sx", "sy", "sz", "tc", "td", "tf", "tg", "th", "tj", "tk",
"tl", "tm", "tn", "to", "tr", "tt", "tv", "tw", "tz", "ua",
"ug", "um", "us", "uy", "uz", "va", "vc", "ve", "vg", "vi",
"vn", "vu", "wf", "ws", "xk", "ye", "yt", "za", "zm", "zw"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the heebie jeebies from this enum and am wondering why we're doing all this work in the specification.
The bug report is caused by the issue that our API forwards the path parameter without making it uppercase.
The minimal fix for this would be a strtoupper() in the API and we're done, or am I overlooking something?

It's nice to make the regex an enum, but I think we should leave that as the only change in this PR.

@daniel-myparcel daniel-myparcel Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. The ticket title says the issue is [api-specification] lowercase country code accepted which insinuates the bug is in the spec (since we also use it to validate the request body).

Now that I read the ticket again getting an empty response as the ticket mentions menas it does infact pass validation and so this is not the bug.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that even if this doesn't fix an actual bug in the flow we might want to keep this for semantic purposes.
The Spec does accepts lowercase country codes so having it reflected in the Spec is arguably logical

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

],
"example": "GB",
"description": "Country code in ISO 3166-1 alpha-2 format (uppercase or lowercase)."
}