From b2890c377d9e9f68c689a07ff600063863e15373 Mon Sep 17 00:00:00 2001 From: Kratos2k7 Date: Tue, 9 Jun 2026 18:52:43 +0500 Subject: [PATCH] fix: enforce resolution/size constraint on output schema for non-mp3 formats Adds a superRefine check to outputOutputSchema via fix-discriminator.cjs so that any generated @shotstack/schemas release rejects renders that specify neither resolution nor a complete size (width + height). mp3 format is exempt. Mirrors the defence-in-depth guard already added to shotstack-edit-api's zodValidator.js. Fixes the root cause of the engine SIGABRT triggered by payloads like { format: "mp4", aspectRatio: "9:16" } passing API validation with no output dimensions. --- schemas/output.yaml | 5 ++++- scripts/fix-discriminator.cjs | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/schemas/output.yaml b/schemas/output.yaml index fc4ce0c..474b8cd 100644 --- a/schemas/output.yaml +++ b/schemas/output.yaml @@ -1,5 +1,7 @@ Output: - description: The output format, render range and type of media to generate. + description: >- + The output format, render range and type of media to generate. + For all formats except `mp3`, either `resolution` or `size` (with both `width` and `height`) must be specified. properties: format: description: >- @@ -24,6 +26,7 @@ resolution: description: >- The preset output resolution of the video or image. For custom sizes use the `size` property. + Either `resolution` or `size` (with both `width` and `height`) must be specified for all formats except `mp3`.