Skip to content

Commit

Permalink
Merge branch 'main' into filename_for_single_service
Browse files Browse the repository at this point in the history
  • Loading branch information
Dipto-at-sap authored Jan 10, 2025
2 parents 9f5f9ad + e4a25cd commit d9d3582
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/compile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ function* _iterate(openApiDocs) {
}
}

function nameParts(qualifiedName) {
const pos = qualifiedName.lastIndexOf('.');
console.assert(pos > 0, 'Invalid qualified name ' + qualifiedName);
return qualifiedName.substring(0, pos);
}

function _getOpenApi(csdl, options, serviceName = "") {
const openApiDocs = {};
let filename;
Expand All @@ -69,6 +75,10 @@ function _getOpenApi(csdl, options, serviceName = "") {

const openapi = csdl2openapi.csdl2openapi(csdl, sOptions);

if(!serviceName) {
serviceName= nameParts(csdl.$EntityContainer);
}

if (protocols.length > 1) {
filename = serviceName + "." + protocol;
} else {
Expand Down

0 comments on commit d9d3582

Please sign in to comment.