Skip to content

Commit

Permalink
don't add quotes for Web API type parameters; fixes #65
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrRogov committed Feb 3, 2020
1 parent 8d24c30 commit 13cf466
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utilities/buildFunctionParameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = function buildFunctionParameters(parameters) {
if (value === null)
continue;

if (typeof value === "string") {
if (typeof value === "string" && !value.startsWith("Microsoft.Dynamics.CRM")) {
value = "'" + value + "'";
}
//fix #45
Expand Down
4 changes: 4 additions & 0 deletions tests/common-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ describe("Utility.", function () {
var result = Utility.buildFunctionParameters({ param1: { test1: "value", '@odata.type': 'account' } });
expect(result).to.equal("(param1=@p1)?@p1={\"test1\":\"value\",\"@odata.type\":\"account\"}");
});
it("Microsoft.Dynamics.CRM namespace parameter", function(){
var result = Utility.buildFunctionParameters({ param1: "Microsoft.Dynamics.CRM.Enum'Type'", param2: 2, param3: "value2" });
expect(result).to.equal("(param1=@p1,param2=@p2,param3=@p3)?@p1=Microsoft.Dynamics.CRM.Enum'Type'&@p2=2&@p3='value2'");
});
});

describe("getFetchXmlPagingCookie - ", function () {
Expand Down

0 comments on commit 13cf466

Please sign in to comment.