Skip to content

Support getAllCountryIdentifiers endpoints#110

Closed
ZeterTheDuck wants to merge 9 commits into
mainfrom
madsen/support-locations/get-all-countries
Closed

Support getAllCountryIdentifiers endpoints#110
ZeterTheDuck wants to merge 9 commits into
mainfrom
madsen/support-locations/get-all-countries

Conversation

@ZeterTheDuck

@ZeterTheDuck ZeterTheDuck commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR adds support for the following endpoints:

  • GET api/v1/locations/{language}/countries/all
  • GET api/v1/locations/{language}/countries/all/{excludeSupportedCountries

It should be noted, however, that both of these endpoints are essentially the same. The first endpoint has two query parameters for excluding supported countries, or only returning supported countries. The second endpoint has a path variable for whether supported countries should be included, and a query parameter to only return supported countries.

The method names are "getAllCountryIdentifiers" and "getAllCountryIdentifiersWithPathVar". The latter name is subject to change.

To my knowledge, I can't have a method with two endpoints because the OpenAPI generator will make a getAllCountryIdentifiers and a getAllCountryIdentifiers_1 method instead of assigning two endpoints to a single method. Neither can I make one method call the other. So I went with having one method have a more verbose name, and testing each method individually.

When testing, not all tests completed. It should be mentioned that I am trying each supported language, both authenticated and unauthenticated clients, and combinations of the two parameters. Therefore there are 8 tests, for each method, for each language, so I think the API throttled the 112 tests.

This PR also adds a test that was removed when merging #104 into main.

@HMS-Victory HMS-Victory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All tests in the LocationSpec.groovy pass successfully, overall this looks well done.

@HMS-Victory HMS-Victory left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

it might be a little easier to use these two methods if we rename getAllCountryIdentifiersWithPathVar and getAllCountryIdentifiers as 'getUnsupportedCountryIdentifiers' and 'getAllCountryIdentifiers' instead.

@ZeterTheDuck
ZeterTheDuck requested a review from HMS-Victory June 10, 2026 15:37
@ZeterTheDuck

Copy link
Copy Markdown
Contributor Author

it might be a little easier to use these two methods if we rename getAllCountryIdentifiersWithPathVar and getAllCountryIdentifiers as 'getUnsupportedCountryIdentifiers' and 'getAllCountryIdentifiers' instead.

Good idea. I have made that change.

@Jonathan-Zollinger Jonathan-Zollinger left a comment

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.

after rebasing the last PR onto this one, I'm getting several dozen test failures.

…ryIdentifiers

This change is because a future endpoint will get country identifiers for all countries, including unsupported countries, whereas this method only gets country identifiers for supported countries.
This test was accidentally removed in #104.
…ifiersWithPathVar endpoints

The getALlCountryIdentifiersWithPathVar is the same as getAllCountryIdentifiers, but one variable is a path variable instead of a query parameter. The name of this method is subject to change.
@Jonathan-Zollinger
Jonathan-Zollinger force-pushed the madsen/support-locations/get-all-countries branch from 6f498af to a5d7cc2 Compare June 15, 2026 18:36
@ZeterTheDuck

ZeterTheDuck commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Yup, seems I forgot to rename the method in one of the tests in 35da4df

…ntifiers method

The method name was changed in 35da4df and that change was not reflected in the test.
@ZeterTheDuck

Copy link
Copy Markdown
Contributor Author

Should be working now. I figured the edit was a simple refactor and didn't bother cleaning and rebuilding before running tests, I'll be sure to do that in the future.

@ZeterTheDuck

Copy link
Copy Markdown
Contributor Author

Changing PR to draft. I want to review my tests because they are unnecessarily complicated, and could cover more.

@ZeterTheDuck
ZeterTheDuck marked this pull request as draft June 24, 2026 21:31
ZeterTheDuck and others added 2 commits June 29, 2026 15:01
…t English

This greatly reduces the number of tests. Not all languages need to be tested for this method.
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 this pull request may close these issues.

3 participants