From edb68df499c90df4c7fe493ba4a0fd6c33debda7 Mon Sep 17 00:00:00 2001 From: Steven Hall Date: Tue, 14 May 2024 10:59:58 +0100 Subject: [PATCH] Apply fix from marclave --- packages/react-openapi/src/ScalarApiButton.tsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-openapi/src/ScalarApiButton.tsx b/packages/react-openapi/src/ScalarApiButton.tsx index 8417db9e2..0e6ceffe5 100644 --- a/packages/react-openapi/src/ScalarApiButton.tsx +++ b/packages/react-openapi/src/ScalarApiButton.tsx @@ -7,6 +7,7 @@ import { getRequestFromOperation, Query, Header, + RequestBody, } from '@scalar/oas-utils'; import React from 'react'; @@ -99,7 +100,12 @@ export function ScalarApiClient(props: { children: React.ReactNode }) { url: operationData.path, }, getRequestFromOperation( - { ...operation, information: operationData.operation }, + { + ...operation, + information: { + requestBody: operationData.operation.requestBody as RequestBody, + }, + }, { requiredOnly: false }, ), );