Skip to content

feat: expose license_tags to feed and license endpoints#1619

Merged
davidgamez merged 7 commits intomainfrom
copilot/expose-license-tag-information
Mar 11, 2026
Merged

feat: expose license_tags to feed and license endpoints#1619
davidgamez merged 7 commits intomainfrom
copilot/expose-license-tag-information

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

License taxonomy tags (e.g. "family:ODC", "license:open-data-commons") exist in the DB but were not surfaced via the API. This adds license_tags to all feed endpoints (under source_info) and to license endpoints.

API Schema (docs/DatabaseCatalogAPI.yaml)

  • Added license_tags: string[] to SourceInfo schema → propagates to all feed endpoints
  • Added license_tags: string[] to LicenseBase schema → propagates to LicenseWithRules and Licenses endpoints

Python Implementation

  • license_base_impl.py: Extracts license_tags from license_orm.tags (the license_license_tags many-to-many ORM relationship)
  • basic_feed_impl.py: Extracts license_tags from feed.license.tags, passes to SourceInfo

Example response shape:

{
  "source_info": {
    "license_id": "ODbL-1.0",
    "license_tags": ["family:ODC", "license:open-data-commons"]
  }
}
{
  "id": "ODbL-1.0",
  "license_tags": ["family:ODC", "license:open-data-commons"],
  "license_rules": [...]
}

Generated Code (regenerated, not committed)

  • api/src/feeds_gen/ — regenerated from updated YAML
  • web-app/src/app/services/feeds/types.ts — regenerated via openapi-typescript@6.7.6

Test Infrastructure

  • populate_db_test_data.py: Added support for license_tag_groups, license_tags, and license_license_tags sections in test data JSON
  • Integration test data: Added tag groups, tags (family:ODC, license:open-data-commons), and associations to license-1
  • Integration tests: Updated license and feed tests to assert license_tags in responses
Original prompt

This section details on the original issue you should resolve

<issue_title>Expose the license tag information to the feed and license endpoints</issue_title>
<issue_description>### Describe the problem

Expose the license tag information to the feed and license endpoints.

Proposed solution

Expose the license tag to the feed endpoints:

  • v1/feeds
  • v1/feeds/{id}
  • v1/gtfs_feeds/{id}
  • v1/gtfs_feeds/{id}
  • v1/gbfs_feeds
  • v1/gbfs_feeds/{id}
  • v1/gtfs_rt_feeds/{id}
  • v1/gtfs_rt_feeds/{id}
    For those endpoints, the field to add is under source_info, for example:
{
...
"source_info": 
"license_tags": [
"family:ODC",
"license:open-data-commons"
]
...
}

Expose the license tag to the license endpoint:

  • v1/license/{id}
    with structure:
...
"license_tags": [
"family:ODC",
"license:open-data-commons"
]
...

Alternatives you've considered

No response

Additional context

No response</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@CLAassistant
Copy link

CLAassistant commented Mar 10, 2026

CLA assistant check
All committers have signed the CLA.

Copilot AI and others added 2 commits March 10, 2026 19:58
Co-authored-by: davidgamez <1192523+davidgamez@users.noreply.github.com>
Co-authored-by: davidgamez <1192523+davidgamez@users.noreply.github.com>
Copilot AI changed the title [WIP] Expose the license tag information to endpoints Expose license_tags to feed and license endpoints Mar 10, 2026
@github-actions
Copy link

github-actions bot commented Mar 10, 2026

*Lighthouse ran on https://mobility-feeds-dev--pr-1619-cx6c8410.web.app/ * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 62 🟢 100 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1619-cx6c8410.web.app/feeds * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 72 🟢 91 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1619-cx6c8410.web.app/feeds/gtfs/mdb-2126 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 78 🔴 0 🟢 93 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1619-cx6c8410.web.app/feeds/gtfs_rt/mdb-2585 * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟠 87 🟠 87 🟢 100 🟢 100

*Lighthouse ran on https://mobility-feeds-dev--pr-1619-cx6c8410.web.app/gbfs/gbfs-flamingo_porirua * (Desktop)
⚡️ HTML Report Lighthouse report for the changes in this PR:

Performance Accessibility Best Practices SEO
🟢 100 🟢 100 🟢 100 🟢 100

@github-actions
Copy link

Preview Firebase Hosting URL: https://mobility-feeds-dev--pr-1619-cx6c8410.web.app

@davidgamez davidgamez marked this pull request as ready for review March 10, 2026 21:47
@davidgamez davidgamez changed the title Expose license_tags to feed and license endpoints feat: expose license_tags to feed and license endpoints Mar 11, 2026
description: Get GBFS feeds from the Mobility Database.
tags:
- "feeds"
- "beta"
Copy link
Member

@davidgamez davidgamez Mar 11, 2026

Choose a reason for hiding this comment

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

Removed beta endpoint tags as they are not beta anymore.

@davidgamez davidgamez requested a review from cka-y March 11, 2026 14:35
@davidgamez
Copy link
Member

Example request is DEV:

curl --request GET \
  --url https://api-dev.mobilitydatabase.org/v1/feeds \
  --header 'Authorization: Bearer <TOKEN HERE>'

Response:

  {
    "id": "tdg-80032",
    "data_type": "gtfs_rt",
    "created_at": "2026-01-12T14:42:35.943189Z",
    "external_ids": [
      {
        "external_id": "80032",
        "source": "tdg"
      }
    ],
    "provider": "Angers Loire Métropole",
    "feed_contact_email": null,
    "source_info": {
      "producer_url": "https://www.data.gouv.fr/api/1/datasets/r/3349a69a-bc9a-4de4-a2c2-9f9d32e4923c",
      "authentication_type": 0,
      "authentication_info_url": null,
      "api_key_parameter_name": null,
      "license_url": "https://opendatacommons.org/licenses/odbl/1.0/",
      "license_id": "ODbL-1.0",
      "license_is_spdx": true,
      "license_notes": null,
      "license_tags": [
        "domain:data",
        "family:ODC",
        "license:open-data-commons",
        "notes:attribution-required",
        "notes:share-alike",
        "spdx:fsf-free"
      ]
    },
    "redirects": [],
    "status": "deprecated",
    "official": true,
    "official_updated_at": "2026-01-12T14:42:36.675550",
    "feed_name": "Réseau urbain Irigo",
    "note": null,
    "related_links": []
  },

@davidgamez davidgamez requested a review from jcpitre March 11, 2026 15:17
* "license:open-data-commons"
* ]
*/
license_tags?: string[];
Copy link
Contributor

Choose a reason for hiding this comment

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

[out of scope for this PR] are we dropping the web app folder from this repo now that we have the beautiful SSR repo?

Copy link
Member

@davidgamez davidgamez Mar 11, 2026

Choose a reason for hiding this comment

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

This will be done with the JS here soon! We are currently monitoring the SSR deployment. cc: @Alessandro100

Copy link
Contributor

@cka-y cka-y left a comment

Choose a reason for hiding this comment

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

LGTM! Bravo to Copilot and Claude 🥳

@davidgamez davidgamez merged commit 8a55476 into main Mar 11, 2026
13 checks passed
@davidgamez davidgamez deleted the copilot/expose-license-tag-information branch March 11, 2026 17:30
@davidgamez
Copy link
Member

LGTM! Bravo to Copilot and Claude 🥳

I helped too 🤣 ...

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.

Expose the license tag information to the feed and license endpoints

4 participants