Skip to content

Comments

Feature/robust api handling 268#319

Open
sr-857 wants to merge 2 commits intoGauravKarakoti:mainfrom
sr-857:feature/robust-api-handling-268
Open

Feature/robust api handling 268#319
sr-857 wants to merge 2 commits intoGauravKarakoti:mainfrom
sr-857:feature/robust-api-handling-268

Conversation

@sr-857
Copy link

@sr-857 sr-857 commented Feb 20, 2026

PR 2: Robust SideShift API Handling (#268)

Technical Analysis

API responses from SideShift were being used directly without validation, leading to potential runtime errors if the API structure changed or returned unexpected data. The existing TypeScript interfaces were not enforced at runtime.

Proposed Solution

Implement Zod schemas to validate API responses at runtime. This provides strict type safety and allows the application to fail gracefully with clear error messages if validation fails.

Changes

  • Implemented Zod schemas in shared/schemas/sideshift.ts.
  • Integrated schema parsing in both frontend and bot SideShift clients.
  • Replaced direct interface casting with Schema.parse(response.data).

Verification

  • Verified successful parsing of mock API responses.
  • Confirmed that validation errors are caught and logged.

@vercel
Copy link
Contributor

vercel bot commented Feb 20, 2026

@sr-857 is attempting to deploy a commit to the Gaurav's projects Team on Vercel.

A member of the Team first needs to authorize it.

@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for swapsmithminiapp canceled.

Name Link
🔨 Latest commit d286281
🔍 Latest deploy log https://app.netlify.com/projects/swapsmithminiapp/deploys/6998b59b95b8a40008ff77a0

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.

1 participant