Fix URI parsing + typebox/typescript/node upgrade#227
Conversation
|
Visit the preview URL for this PR (updated for commit 8294073):
(expires Tue, 24 Mar 2026 20:56:19 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 0c15c45ea5a4c54095387eacf30c3755c9260f22 |
There was a problem hiding this comment.
Pull request overview
This PR aims to broaden API request validation for link fields by accepting "url" in addition to "uri" in several TypeBox schemas.
Changes:
- Updated sponsor/job post schemas to accept
externalLinkasuri | url - Updated sponsor schemas to accept
website/logoUrlasuri | url - Updated sessions/speakers and file reupload schemas to accept various link fields as
uri | url(plusnullwhere applicable)
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| functions/src/api/routes/sponsors/updateJobPostPUT.ts | Expands externalLink validation to `uri |
| functions/src/api/routes/sponsors/addSponsorsPOST.ts | Expands website/logoUrl validation to `uri |
| functions/src/api/routes/sponsors/addJobPostPOST.ts | Expands job post externalLink validation to `uri |
| functions/src/api/routes/sessionsSpeakers/sessionsSpeakers.ts | Expands multiple speaker/session link fields to `uri |
| functions/src/api/routes/file/downloadAndReuploadFilePOST.ts | Expands url body field validation to `uri |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Updates the Cloud Functions Fastify API to use the newer typebox package (and updated Fastify TypeBox type provider), with accompanying TypeBox import/format-registry changes across routes so schemas continue to build and Swagger remains registered.
Changes:
- Upgraded
@fastify/type-provider-typeboxand migrated from@sinclair/typeboxtotypebox, updating imports across API/service routes. - Updated TypeBox custom format registration to use
typebox/formatAPIs. - Adjusted TS/Fastify typing and schema definitions (e.g.,
FilesOutputsunion) and enabledskipLibCheckin the functions TS config.
Reviewed changes
Copilot reviewed 33 out of 34 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| functions/tsconfig.json | Enables skipLibCheck in the functions TypeScript build. |
| functions/package.json | Upgrades @fastify/type-provider-typebox and replaces @sinclair/typebox with typebox. |
| functions/package-lock.json | Lockfile updates reflecting the dependency upgrades/removal. |
| functions/src/serviceApi/pdf.ts | Migrates TypeBox import to typebox. |
| functions/src/api/swagger.ts | Adjusts Fastify instance typing for Swagger registration. |
| functions/src/api/apiKeyPlugin.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/other/addContentTypeParserForServerless.ts | Adjusts Fastify instance typing for the parser helper. |
| functions/src/api/other/typeBoxAdditionalsFormats.ts | Switches custom format registration to typebox/format. |
| functions/src/api/routes/transcription/transcription.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/addJobPostPOST.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/addSponsorsPOST.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/approveJobPostPUT.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/deleteJobPostDELETE.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/generateSponsorTokenPOST.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/getJobPostGET.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/getJobPostsGET.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/getSponsorJobPostsGET.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/trackJobPostClickPOST.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sponsors/updateJobPostPUT.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sessions/sessions.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/sessionsSpeakers/sessionsSpeakers.ts | Migrates TypeBox imports and switches format registration to typebox/format. |
| functions/src/api/routes/sessionsSpeakers/verifyOverwriteData.ts | Migrates TypeBox/Value imports to typebox modules. |
| functions/src/api/routes/file/addFilePOST.ts | Migrates TypeBox imports and rewrites the union schema definition. |
| functions/src/api/routes/file/downloadAndReuploadFilePOST.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/faq/faq.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/event/getEvent.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/event/getPdfMetadata.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/event/exportSchedulePdf.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/deploy/deploy.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/deploy/getDeployFiles.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/bupher/bupherChannelsRoute.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/bupher/bupherDraftPostRoute.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/bupher/bupherLoginRoute.ts | Migrates TypeBox imports to typebox. |
| functions/src/api/routes/bupher/bupherScheduledPostsRoute.ts | Migrates TypeBox imports to typebox. |
Files not reviewed (1)
- functions/package-lock.json: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| "outDir": "lib", | ||
| "sourceMap": true, | ||
| "strict": true, | ||
| "skipLibCheck": true, |
| import { FastifyInstance } from 'fastify' | ||
|
|
||
| export const addContentTypeParserForServerless = (fastify: FastifyInstance) => { | ||
| export const addContentTypeParserForServerless = (fastify: FastifyInstance<any, any, any, any, any>) => { |
Uh oh!
There was an error while loading. Please reload this page.