mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-10-31 09:30:10 +00:00
Keep the 0.29 compatibility fixes minimal
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import type { OpenAPIV3, OpenAPIV3_1 } from '@scalar/openapi-types';
|
||||
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
export type AnyObject = Record<string, any>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,14 +10,8 @@ import { parseOpenAPIV3 } from './v3';
|
||||
export async function convertOpenAPIV2ToOpenAPIV3(
|
||||
input: ParseOpenAPIInput
|
||||
): Promise<ParseOpenAPIResult> {
|
||||
const { specification } = upgradeFromInput(input);
|
||||
if (!specification) {
|
||||
throw new OpenAPIParseError('Failed to convert Swagger 2.0 to OpenAPI 3.1.1', {
|
||||
code: 'v2-conversion',
|
||||
rootURL: input.rootURL,
|
||||
});
|
||||
}
|
||||
return parseOpenAPIV3({ ...input, rootURL: input.rootURL, value: specification });
|
||||
const result = upgradeFromInput(input);
|
||||
return parseOpenAPIV3({ ...input, rootURL: input.rootURL, value: result.specification! });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user