From a79c6213f980fb33fad5564379ec7e09e5f0e7d3 Mon Sep 17 00:00:00 2001 From: ZeterTheDuck Date: Fri, 29 May 2026 12:58:59 -0600 Subject: [PATCH 1/2] feat: add schema for getAllCountryIdentifiers --- core/src/main/resources/schema.yml | 48 ++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/core/src/main/resources/schema.yml b/core/src/main/resources/schema.yml index 69fb5c9..ce70a11 100644 --- a/core/src/main/resources/schema.yml +++ b/core/src/main/resources/schema.yml @@ -84,6 +84,36 @@ paths: type: array items: $ref: "#/components/schemas/CountryContext" + /api/v1/locations/{language}/countries/postal: + get: + description: Get identifiers for all countries + operationId: getAllCountryIdentifiers + tags: [ Location ] + parameters: + - name: language + in: path + required: true + schema: + type: string + responses: + '200': + description: OK + content: + text/plain: + schema: + type: array + items: + $ref: "#/components/schemas/CountryIdentifiers" + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/CountryIdentifiers" + text/json: + schema: + type: array + items: + $ref: "#/components/schemas/CountryIdentifiers" /api/v1/locations/{parentId}/{locale}: get: description: Get the children of a parent location, in a certain locale @@ -2070,6 +2100,24 @@ components: county: type: string nullable: true + CountryIdentifiers: + description: Standardized identifiers for a country. + allOf: + - $ref: "#/components/schemas/CountryInfo" + - type: object + properties: + usePostal: + type: boolean + countryName: + description: name of the country + type: string + nullable: true + countryId: + description: UUID associated with this country + type: string + format: uuid # This restriction is not present in swagger.json, but all returns are of UUID form + nullable: true + additionalProperties: false LocaleNames: type: object properties: From f2ae315a402c94bbcce59a0f6810c5fafcbf8861 Mon Sep 17 00:00:00 2001 From: ZeterTheDuck Date: Fri, 29 May 2026 13:05:43 -0600 Subject: [PATCH 2/2] test: add test for getAllCountryIdentifiers --- .../test/groovy/org/justserve/LocationSpec.groovy | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/src/test/groovy/org/justserve/LocationSpec.groovy b/core/src/test/groovy/org/justserve/LocationSpec.groovy index d322c9f..b2c4ef4 100644 --- a/core/src/test/groovy/org/justserve/LocationSpec.groovy +++ b/core/src/test/groovy/org/justserve/LocationSpec.groovy @@ -38,4 +38,17 @@ class LocationSpec extends JustServeSpec { [[client, userType], lang] << [[[noAuthLocationClient, "no auth"], [locationClient, "standard"]], threeCharLocales].combinations() } + @SuppressWarnings("GroovyAssignabilityCheck") + @Unroll("Can query LocationClient.getAllCountryIdentifiers(#lang) with no error as #userType") + def "can query all country identifiers for a given language"(LocationClient client, String userType, String lang) { + when: + client.getAllCountryIdentifiers(lang).block() + + then: + noExceptionThrown() + + where: + [[client, userType], lang] << [[[noAuthLocationClient, "no auth"], [locationClient, "standard"]], threeCharLocales].combinations() + } + }