Skip to content
Merged
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
48 changes: 48 additions & 0 deletions core/src/main/resources/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
13 changes: 13 additions & 0 deletions core/src/test/groovy/org/justserve/LocationSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

}
Loading