File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
server/node-service/src/plugins/couchdb Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import spec from "./CouchDB-3.1.1-resolved.json";
7
7
import { specsToOptions } from "../../common/util" ;
8
8
const specs = {
9
9
"v1.0" : spec ,
10
- "v2.0" : spec ,
11
10
}
12
11
const dataSourceConfig = {
13
12
type : "dataSource" ,
@@ -71,8 +70,8 @@ const couchdbPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
71
70
icon : "couchdb.svg" ,
72
71
category : "database" ,
73
72
dataSourceConfig,
74
- queryConfig : async ( ) => {
75
- const { actions, categories } = await parseOpenApi ( spec as OpenAPI . Document , parseOptions ) ;
73
+ queryConfig : async ( data ) => {
74
+ const { actions, categories } = await parseOpenApi ( specs [ data . specVersion as keyof typeof specs ] as OpenAPI . Document , parseOptions ) ;
76
75
return {
77
76
type : "query" ,
78
77
label : "Operation" ,
@@ -91,7 +90,7 @@ const couchdbPlugin: DataSourcePlugin<any, DataSourceConfigType> = {
91
90
dynamicParamsConfig : otherDataSourceConfig ,
92
91
specVersion : dataSourceConfig . specVersion
93
92
} ;
94
- return runOpenApi ( actionData , runApiDsConfig , spec as OpenAPIV2 . Document ) ;
93
+ return runOpenApi ( actionData , runApiDsConfig , specs [ dataSourceConfig . specVersion as keyof typeof specs ] as OpenAPIV2 . Document ) ;
95
94
} ,
96
95
} ;
97
96
You can’t perform that action at this time.
0 commit comments