Skip to content

feat: add created_at feed filters - #1821

Open
mackenziereading19 wants to merge 1 commit into
MobilityData:mainfrom
mackenziereading19:feat/874-created-at-filter
Open

feat: add created_at feed filters#1821
mackenziereading19 wants to merge 1 commit into
MobilityData:mainfrom
mackenziereading19:feat/874-created-at-filter

Conversation

@mackenziereading19

@mackenziereading19 mackenziereading19 commented Aug 30, 2026

Copy link
Copy Markdown
Contributor

Summary:

Adds created_after and created_before query parameters to the feed-list endpoints so API consumers can filter feeds based on when they were added to the Mobility Database.

This addresses #874, where stakeholders want to track newly added feeds. The created_after / created_before naming follows the existing downloaded_after / downloaded_before API pattern.

The filters are available on:

  • /v1/feeds
  • /v1/gtfs_feeds
  • /v1/gtfs_rt_feeds
  • /v1/gbfs_feeds

Expected behavior:

created_after and created_before accept ISO date/time values and apply inclusive bounds:

  • created_aftercreated_at >= value
  • created_beforecreated_at <= value

They can be supplied independently or together to define a range. Invalid date values return 422.

No database migration is required because created_at already exists on feed records.

Testing tips:

Test any of the four feed-list endpoints with:

  • ?created_after=<ISO datetime>
  • ?created_before=<ISO datetime>
  • both parameters together
  • an invalid date value to verify the 422 response

Integration tests cover all four endpoints, inclusive boundary behavior, combined ranges, and invalid values.

Local verification:

  • Full feed API integration suite: 111 passed

  • Broader relevant feed tests: 144 passed

  • Focused created_at tests: 16 passed

  • Black: passed

  • git diff --check: passed

  • Run the unit tests with ./scripts/api-tests.sh to make sure you didn't break anything

  • Add or update any needed documentation to the repo

  • Format the title like "feat: [new feature short description]". Title must follow the Conventional Commit Specification

  • Linked all relevant issues

  • Include screenshot(s) showing how this pull request works and fixes the issue(s)

Closes #874

@welcome

welcome Bot commented Aug 30, 2026

Copy link
Copy Markdown

Thanks for opening this pull request! You're awesome. We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should update your pull request title to start with a semantic prefix. Examples of titles with semantic prefixes:

  • fix: Bug with ssl network connections + Java module permissions.
  • feat: Initial support for multiple @PrimaryKey annotations.
  • docs: update RELEASE.md with new process
    To get this PR to the finish line, please do the following:
  • Include tests when adding/changing behavior
  • Include screenshots

@mackenziereading19

Copy link
Copy Markdown
Contributor Author

Added screenshots from the local Swagger UI running this PR against the populated test database.

  1. GET /v1/feeds exposes the new created_after and created_before query parameters.
  2. A request using created_after=2026-08-30T19:47:40.620207Z returns HTTP 200 and includes gbfs-system_id_3, whose created_at is exactly 2026-08-30T19:47:40.620207Z, demonstrating the inclusive lower bound.
  3. An invalid created_after value returns HTTP 422 with the expected ISO 8601 validation message.

The automated integration tests additionally cover both bounds, combined ranges, invalid values, and all four feed-list endpoints.
Screenshot 2026-08-30 at 20 58 13
Screenshot 2026-08-30 at 20 58 24
Screenshot 2026-08-30 at 20 57 52

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.

Add created_at filter

3 participants