Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions lib/compile/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,20 @@ function _getProtocols(csdl, csn, odataVersion) {
protocols.push(service["@protocol"]);
} else if (Array.isArray(service["@protocol"])) {
service["@protocol"].forEach((protocol) => {
if (protocol === "rest" || protocol === "odata" || protocol === "odata-v4") {
protocols.push(protocol);
if(typeof protocol === "string"){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like odata-v4 got lost?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

if (protocol === "rest" || protocol === "odata") {
protocols.push(protocol);
} else {
DEBUG?.(`"${protocol}" protocol is not supported`);
}
} else if (typeof protocol === "object" && !Array.isArray(protocol) && protocol !== null) {
if(protocol.kind === "rest" || protocol.kind === "odata") {
protocols.push(protocol.kind);
} else {
DEBUG?.(`"${protocol.kind}" protocol is not supported`);
}
} else {
DEBUG?.(`"${protocol}" protocol is not supported`);
DEBUG?.(`incorrect ${protocol} type`)
}
});
}
Expand All @@ -184,4 +194,4 @@ function _servicePath(csdl, csn, protocols) {

return paths;
}
}
}