Is there an existing issue for this?
Current Behavior
In the function _servicePath in ib/compile/index.js#L201 the value of the @protocol annotation of the given CDS service gets changed and is never restored to its original value. This means that using the OpenAPI compiler has unwanted side effects that change (and potentially break) CDS services for the entire runtime of an application.
Expected Behavior
Using the OpenAPI compiler does not result in unwanted / unexpected side effects.
Anything else?
Proposal for a fix:
function _servicePath(csdl, csn, protocols) {
if (csdl.$EntityContainer && Array.isArray(protocols)) {
const serviceName = csdl.$EntityContainer.replace(/\.[^.]+$/, "");
return Object.fromEntries(
protocols
.map(protocol => { ...csn.definitions[serviceName], "@protocol: protocol })
.map(service => [ service["@protocol"], cds.service.path4?.(service) || cds.serve.path4(service)])
);
}
return {}
}
Is there an existing issue for this?
Current Behavior
In the function
_servicePathin ib/compile/index.js#L201 the value of the@protocolannotation of the given CDS service gets changed and is never restored to its original value. This means that using the OpenAPI compiler has unwanted side effects that change (and potentially break) CDS services for the entire runtime of an application.Expected Behavior
Using the OpenAPI compiler does not result in unwanted / unexpected side effects.
Anything else?
Proposal for a fix: