File tree Expand file tree Collapse file tree 7 files changed +522
-38
lines changed Expand file tree Collapse file tree 7 files changed +522
-38
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @gitbook/openapi-parser " : patch
3
+ ---
4
+
5
+ Upgrade Scalar dependencies
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 12
12
"version" : " 3.0.1" ,
13
13
"sideEffects" : false ,
14
14
"dependencies" : {
15
- "@scalar/openapi-parser" : " ^0.18.0" ,
16
- "@scalar/openapi-types" : " ^0.1.9"
15
+ "@scalar/json-magic" : " ^0.3.1" ,
16
+ "@scalar/openapi-parser" : " ^0.20.1" ,
17
+ "@scalar/openapi-types" : " ^0.3.7"
17
18
},
18
19
"devDependencies" : {
19
20
"@tsconfig/strictest" : " ^2.0.5" ,
Original file line number Diff line number Diff line change 1
- import { bundle } from '@scalar/openapi-parser ' ;
2
- import { parseJson , parseYaml } from '@scalar/openapi-parser/ plugins- browser' ;
1
+ import { bundle } from '@scalar/json-magic/bundle ' ;
2
+ import { parseJson , parseYaml } from '@scalar/json-magic/bundle/ plugins/ browser' ;
3
3
import type { ParseOpenAPIInput } from './parse' ;
4
4
import { fetchURL } from './scalar-plugins/fetchURL' ;
5
5
import { fetchURLs } from './scalar-plugins/fetchURLs' ;
Original file line number Diff line number Diff line change 1
- import type { AnyObject , ErrorObject , bundle } from '@scalar/openapi-parser' ;
1
+ import type { Plugin } from '@scalar/json-magic/bundle' ;
2
+ import type { AnyObject , ErrorObject } from '@scalar/openapi-parser' ;
2
3
import { OpenAPIParseError } from './error' ;
3
4
import type { Filesystem , OpenAPIV3xDocument } from './types' ;
4
5
import { convertOpenAPIV2ToOpenAPIV3 } from './v2' ;
5
6
import { parseOpenAPIV3 } from './v3' ;
6
7
7
- export type ParsePlugin = Parameters < typeof bundle > [ 1 ] [ 'plugins' ] [ number ] ;
8
-
9
8
export interface ParseOpenAPIInput {
10
9
/**
11
10
* The API definition to parse.
@@ -19,7 +18,7 @@ export interface ParseOpenAPIInput {
19
18
* Options for the parser.
20
19
*/
21
20
options ?: {
22
- plugins ?: ParsePlugin [ ] ;
21
+ plugins ?: Plugin [ ] ;
23
22
} ;
24
23
}
25
24
Original file line number Diff line number Diff line change
1
+ import type { Plugin } from '@scalar/json-magic/bundle' ;
1
2
import { normalize } from '@scalar/openapi-parser' ;
2
- import type { ParsePlugin } from '../parse' ;
3
3
4
4
export const fetchUrlsDefaultConfiguration = {
5
5
limit : 40 ,
6
6
} ;
7
7
8
- export const fetchURL = ( ) : ParsePlugin => ( {
8
+ export const fetchURL = ( ) : Plugin => ( {
9
+ type : 'loader' ,
9
10
validate ( value ) {
10
11
return URL . canParse ( value ) ;
11
12
} ,
Original file line number Diff line number Diff line change
1
+ import type { Plugin } from '@scalar/json-magic/bundle' ;
1
2
import { normalize } from '@scalar/openapi-parser' ;
2
- import type { ParsePlugin } from '../parse' ;
3
3
4
4
export const fetchUrlsDefaultConfiguration = {
5
5
limit : 40 ,
@@ -15,7 +15,7 @@ export const fetchURLs = (customConfiguration: {
15
15
* Limit the number of requests. Set to `false` to disable the limit.
16
16
*/
17
17
limit ?: number | false ;
18
- } ) : ParsePlugin => {
18
+ } ) : Plugin => {
19
19
// State
20
20
let numberOfRequests = 0 ;
21
21
@@ -26,6 +26,7 @@ export const fetchURLs = (customConfiguration: {
26
26
} ;
27
27
28
28
return {
29
+ type : 'loader' ,
29
30
validate ( value ) {
30
31
// Not a string
31
32
if ( typeof value !== 'string' ) {
You can’t perform that action at this time.
0 commit comments