Skip to content

Implement API for getting geographic subdivisions #70

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

Open
wants to merge 3 commits into
base: 2.x
Choose a base branch
from

Conversation

nnpvaan
Copy link

@nnpvaan nnpvaan commented Jul 1, 2025

Description of the issue/feature this PR addresses

This PR implements a new geographic subdivisions API endpoint for SENAITE JSON API that provides access to geographic data (states/provinces, and counties/districts)

Current behavior before PR

Did not provide a dedicated endpoint for geographic subdivisions. Clients requiring geographic data would need to:

  • Use the existing address widget's AJAX endpoint which has limited functionality
  • Access geographic information only through the core geo API functions directly

Desired behavior after PR is merged

Have access to a comprehensive geographic subdivisions API with the following capabilities:
API Endpoints:

  • GET /senaite/v1/geographic/subdivisions_schema - Returns all subdivisions
  • GET /senaite/v1/geographic/subdivisions_schema?country=CODE - Returns subdivisions for specific country
  • GET /senaite/v1/geographic/subdivisions_schema?depth=LEVEL - Returns subdivisions at specific depth
  • GET /senaite/v1/geographic/subdivisions_schema?country=CODE&depth=LEVEL - Returns filtered subdivisions

--
I confirm I have tested the PR thoroughly and coded it according to PEP8
standards.

@nnpvaan nnpvaan changed the title Implement API get geographic subdivisions Implement API for getting geographic subdivisions Jul 2, 2025
@nnpvaan nnpvaan force-pushed the api-get-geo-subdivisions branch from 1752cd1 to 684d660 Compare July 2, 2025 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant