Skip to content

Commit a3d74a9

Browse files
committed
fix: fixing API version recognition regexp
1 parent 97a806f commit a3d74a9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

demo/demo-server/api.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ async function apiRequest(ctx) {
2626
}
2727
} catch (e) {
2828
body = wrapError(e);
29+
console.error(e);
2930
}
3031
/* eslint-disable require-atomic-updates */
3132
if (body.code) {

demo/demo-server/api/amf-service/api-search.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class ApiSearch {
134134
contentType: 'application/json'
135135
};
136136
}
137-
const oasMatch = data.match(/openapi|swagger(?:\s*)?:(?:\s*)("|')?(\d\.\d*)("|')?/im);
137+
const oasMatch = data.match(/(?:openapi|swagger)[^\s*]?:(?:\s*)("|')?(\d\.\d)("|')?/im);
138138
if (oasMatch) {
139139
const v = oasMatch[2].trim();
140140
return {

0 commit comments

Comments
 (0)