From 69f697aab04d0d2a22deef1529e4b10870c070ad Mon Sep 17 00:00:00 2001 From: Roshni Naveena S Date: Wed, 9 Oct 2024 00:46:13 +0530 Subject: [PATCH 1/3] Update csdl2openapi.js --- lib/compile/csdl2openapi.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/compile/csdl2openapi.js b/lib/compile/csdl2openapi.js index f1d7145..d77c980 100644 --- a/lib/compile/csdl2openapi.js +++ b/lib/compile/csdl2openapi.js @@ -2445,6 +2445,10 @@ see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-prot */ function security(openapi, entityContainer) { const securitySchemes = entityContainer && entityContainer[voc.Authorization.SecuritySchemes] ? entityContainer[voc.Authorization.SecuritySchemes] : []; + // check if securitySchemas exist if it does not exist then throw a warning + if (securitySchemes.length === 0) { + console.warn('No security schemes defined in the entity container'); + } if (securitySchemes.length > 0) openapi.security = []; securitySchemes.forEach(scheme => { const s = {}; From 12ad621ab3a0672a2f63cc69d63671d4b321c7eb Mon Sep 17 00:00:00 2001 From: Roshni Naveena S Date: Wed, 9 Oct 2024 00:55:38 +0530 Subject: [PATCH 2/3] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2126d09..c1af4d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - OpenAPI documents can now have `externalDocs` object provided through `@OpenAPI.externalDocs` annotation in the service level of CDS. +- OpenAPI documents now throws warning if `securitySchemes` are not found. ## Version 1.0.6 - 23.09.2024 From bd59e31453343df809c67d299f87028b285eca73 Mon Sep 17 00:00:00 2001 From: Roshni Naveena S Date: Thu, 17 Oct 2024 11:48:26 +0530 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1af4d8..bc63bbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/). ### Added - OpenAPI documents can now have `externalDocs` object provided through `@OpenAPI.externalDocs` annotation in the service level of CDS. -- OpenAPI documents now throws warning if `securitySchemes` are not found. +- OpenAPI documents now throws warning if `securitySchemas` are not found. ## Version 1.0.6 - 23.09.2024