File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,6 @@ export const deployCommand = new Command()
2626 console . error ( "OpenAPI specification validation failed." ) ;
2727 return ;
2828 }
29- const accountId = xMbSpec [ "account-id" ] ;
3029
3130 const pluginService = new PluginService ( ) ;
3231 try {
Original file line number Diff line number Diff line change @@ -52,7 +52,11 @@ async function fetchAndValidateSpec(url: string): Promise<ValidationResult> {
5252 try {
5353 console . log ( "[Dev] Validating OpenAPI spec..." ) ;
5454 const validation = await validateAndParseOpenApiSpec ( specUrl ) ;
55- ( { isValid, accountId } = validation ) ;
55+ if ( ! validation ) {
56+ throw new Error ( "Invalid OpenAPI spec" ) ;
57+ }
58+ isValid = true ;
59+ accountId = validation [ "account-id" ] ;
5660 console . log ( "[Dev] Validation result:" , { isValid, accountId } ) ;
5761 } catch ( error ) {
5862 console . error (
Original file line number Diff line number Diff line change @@ -51,9 +51,10 @@ export async function validateAndParseOpenApiSpec(
5151 }
5252
5353 const xMbSpec = apiResponse [ "x-mb" ] ;
54- isXMbSpec ( xMbSpec ) ;
55-
56- return xMbSpec ;
54+ if ( isXMbSpec ( xMbSpec ) ) {
55+ return xMbSpec ;
56+ }
57+ throw new Error ( "Invalid OpenAPI spec" ) ;
5758 } catch ( error ) {
5859 console . error (
5960 "Unexpected error:" ,
You can’t perform that action at this time.
0 commit comments