From 6231e00d88dabe48687e6ac11590829236bc4c49 Mon Sep 17 00:00:00 2001 From: Eric Reyes Date: Tue, 30 Dec 2025 18:11:12 -0800 Subject: [PATCH] fix: make license_author nullable in schema and types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wger API can return null for license_author field on exercises and exercise translations. This was causing schema validation errors when searching exercises with muscle/equipment filters. Changes: - src/schemas/api.ts: Changed license_author from z.string() to z.string().nullable() - src/types/wger.ts: Changed license_author from string to string | null 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- src/schemas/api.ts | 2 +- src/types/wger.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/schemas/api.ts b/src/schemas/api.ts index 601fa00..d3f2e2a 100644 --- a/src/schemas/api.ts +++ b/src/schemas/api.ts @@ -44,7 +44,7 @@ export const ExerciseTranslationSchema = z.object({ license: z.number().int().positive(), license_title: z.string(), license_object_url: z.string(), - license_author: z.string(), + license_author: z.string().nullable(), license_author_url: z.string(), license_derivative_source_url: z.string(), author_history: z.array(z.string()), diff --git a/src/types/wger.ts b/src/types/wger.ts index f2a93f5..d4bf684 100644 --- a/src/types/wger.ts +++ b/src/types/wger.ts @@ -56,7 +56,7 @@ export interface ExerciseTranslation { /** License object URL */ license_object_url: string; /** Author of the license */ - license_author: string; + license_author: string | null; /** Author URL */ license_author_url: string; /** Derivative source URL */ @@ -111,7 +111,7 @@ export interface Exercise { /** License object */ license: License; /** Author of the exercise content */ - license_author: string; + license_author: string | null; /** Array of image objects */ images: unknown[]; /** Array of translation objects with name and description in multiple languages */