Skip to content

Commit 13cf466

Browse files
don't add quotes for Web API type parameters; fixes #65
1 parent 8d24c30 commit 13cf466

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

lib/utilities/buildFunctionParameters.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = function buildFunctionParameters(parameters) {
1717
if (value === null)
1818
continue;
1919

20-
if (typeof value === "string") {
20+
if (typeof value === "string" && !value.startsWith("Microsoft.Dynamics.CRM")) {
2121
value = "'" + value + "'";
2222
}
2323
//fix #45

tests/common-tests.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ describe("Utility.", function () {
3535
var result = Utility.buildFunctionParameters({ param1: { test1: "value", '@odata.type': 'account' } });
3636
expect(result).to.equal("(param1=@p1)?@p1={\"test1\":\"value\",\"@odata.type\":\"account\"}");
3737
});
38+
it("Microsoft.Dynamics.CRM namespace parameter", function(){
39+
var result = Utility.buildFunctionParameters({ param1: "Microsoft.Dynamics.CRM.Enum'Type'", param2: 2, param3: "value2" });
40+
expect(result).to.equal("(param1=@p1,param2=@p2,param3=@p3)?@p1=Microsoft.Dynamics.CRM.Enum'Type'&@p2=2&@p3='value2'");
41+
});
3842
});
3943

4044
describe("getFetchXmlPagingCookie - ", function () {

0 commit comments

Comments
 (0)