Skip to content

feat: add driver image URL to all driver-related API endpoints - #50

Open
danilo1992-sys wants to merge 10 commits into
Rafacv23:developmentfrom
danilo1992-sys:feature/driver-images
Open

feat: add driver image URL to all driver-related API endpoints#50
danilo1992-sys wants to merge 10 commits into
Rafacv23:developmentfrom
danilo1992-sys:feature/driver-images

Conversation

@danilo1992-sys

Copy link
Copy Markdown

Summary

Adds an field to all driver-related API endpoints, generating image URLs from the Formula 1 media CDN based on the .

Changes

  • ****: New utility function
  • 12 endpoints updated to include the field in driver responses

Endpoints affected

Endpoint Description
All drivers
Single driver
Driver search
Drivers by year
Driver by year & ID
Driver comparison
Championship by year
Team drivers by year
Current season drivers
Current driver by ID
Current championship
Current team drivers

Example response

{
  "driverId": "alonso",
  "name": "Fernando",
  "surname": "Alonso",
  "image": "https://media.formula1.com/.../alonso.jpg"
}

Verification

  • TypeScript: tsc --noEmit passes ✅
  • Lint: next lint passes ✅

Rafacv23 and others added 10 commits March 28, 2026 22:27
fix/ issue 42, added openapi.yaml file
Signed-off-by: Rafa Canosa <rafacv23@gmail.com>
- Add getDriverImageUrl utility function in lib/utils.ts
- Generate image URLs using Formula 1 media CDN based on driverId
- Add image field to all 12 driver-related endpoints:
  - /api/drivers, /api/drivers/[driverId], /api/drivers/search
  - /api/[year]/drivers, /api/[year]/drivers/[driverId]
  - /api/[year]/compare/[driverId1]/[driverId2]
  - /api/[year]/drivers-championship
  - /api/[year]/teams/[teamId]/drivers
  - /api/current/drivers, /api/current/drivers/[driverId]
  - /api/current/drivers-championship
  - /api/current/teams/[teamId]/drivers
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

@danilo1992-sys is attempting to deploy a commit to the rafacv23's projects Team on Vercel.

A member of the Team first needs to authorize it.

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