Merge pull request #742 from bplatta/updates/import-openapi-v3

OpenApi v3 case fixes
This commit is contained in:
Anoop M D 2023-10-23 23:11:55 +05:30 committed by GitHub
commit 89c5dae881
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,9 +53,15 @@ const buildEmptyJsonBody = (bodySchema) => {
const transformOpenapiRequestItem = (request) => {
let _operationObject = request.operationObject;
let operationName = _operationObject.operationId || _operationObject.summary || _operationObject.description;
if (!operationName) {
operationName = `${request.method} ${request.path}`;
}
const brunoRequestItem = {
uid: uuid(),
name: _operationObject.operationId,
name: operationName,
type: 'http-request',
request: {
url: ensureUrl(request.global.server + '/' + request.path),
@ -100,7 +106,7 @@ const transformOpenapiRequestItem = (request) => {
let auth;
// allow operation override
if (_operationObject.security) {
if (_operationObject.security && _operationObject.security.length > 0) {
let schemeName = Object.keys(_operationObject.security[0])[0];
auth = request.global.security.getScheme(schemeName);
} else if (request.global.security.supported.length > 0) {