Skip to content

Conversation

@alpha912
Copy link
Contributor

@alpha912 alpha912 commented Sep 7, 2025

Summary

  • Add optional filters to /collections/addresses/items: pin, city, ulb_lgd, digipin.
  • Keep existing params (limit, offset, bbox) intact; response remains GeoJSON with pagination links.
  • Add tests: media type correctness, pagination links, PIN filtering, invalid bbox handling. Add conftest.py to make imports robust.

Rationale

  • Enables simple attribute filtering without breaking API compatibility.
  • Improves confidence via HTTP-level tests, aligning with OGC API - Features usage patterns.

Acceptance Criteria

  • GET /collections/addresses/items?pin=560008 returns only features with pin=560008.
  • city, ulb_lgd, digipin filters work as described (case-insensitive for city).
  • Content-Type for items is application/geo+json.
  • Invalid bbox returns HTTP 400 with error JSON.
  • Pagination self and next/prev links computed correctly.
  • All tests pass: pytest in api-server.

Security & Performance

  • In-memory filtering; no persistence layer changes. No new external deps.
  • Inputs are validated via FastAPI; bbox parsing guarded with 400 on invalid.

Docs

  • Parameters are self-documented in OpenAPI via FastAPI (no manual spec edits required). README unchanged.

Breaking Changes

  • None.

Migration Notes

  • None required. Clients can start using new filters when desired.

Linked Issues

  • closes #N/A

Screenshots / Logs

  • 5 passed in api-server tests locally.

Changelog Entry

  • feat: items endpoint supports attribute filters (pin, city, ulb_lgd, digipin).

Reviewers

  • @BharatAddress/maintainers

Labels

  • enhancement, api, tests

@alpha912 alpha912 merged commit 033ba55 into main Sep 8, 2025
3 of 4 checks passed
@alpha912 alpha912 deleted the feat/items-filters branch September 8, 2025 06:29
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.

2 participants