-
Notifications
You must be signed in to change notification settings - Fork 4
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
Enhancement: Allow Users to Specify API Version of URL Endpoint to Query #56
base: master
Are you sure you want to change the base?
Conversation
…t with `click`; see psf/black#2964.
…ttribute in `Client` class with `_get_url_templates` helper method.
…ures referencing (now removed) `URL_TEMPLATES__v1`. Removed stray print statement in tests.
Hi Matt, thanks for your PR. I'm unclear why |
Hey @benpearman. I outline the rationale for this change in #55. For my own understanding, would you be able to give a brief explanation as to why the LINZ's Koordinates site would use 'v1.x' as its endpoint (at least temporarily) instead of 'v1'? If its for maintenance/update purposes, perhaps there should be some kind of 'catch' in the |
The Whereas the I am not sure what happened with the maintenance you reference in that issue, but LINZ's Koordinates site normally uses the |
Hey @benpearman - thanks for that clarification. Just a couple of follow-up points/questions from me:
|
Hope that helps! |
Fixes #55.
Description
Major changes:
url_version
attribute tokoordinates.Client
; this allows the user to explicitly specify the API version of the URL endpoint they'd like to query.api_version
attribute tokoordinates.Client
, which specifies the version of the Koordinates API that should be assumed to work out request/response structures. This can differ from theurl_version
(e.g.api_version='v1'
vsurl_version=v1.x
).URL_TEMPLATES__v1
in favour of a_get_url_templates
helper method. This prints more understandable error messages in cases where the user requests an invalidapi_version
. This change should also make it easier to accommodate newkoordinates
API versions in the future.url_version
attribute.URL_TEMPLATES__v1
.Miscellaneous changes:
black
version in.pre-commit-config.yaml
to 24.8.0 to avoid issues withclick
; see Incompatible with click 8.1.0 (ImportError: cannot import name '_unicodefun' from 'click') psf/black#2964.print
statement in tests.Example:
This prints:
https://data.linz.govt.nz/services/api/v1.x/publish/abc/
.Any feedback/suggestions are welcome.
Cheers,
Matt.