From 9bbd2663f9c0c845f10b08a3ba14202972eb9751 Mon Sep 17 00:00:00 2001 From: "Colin (Johnson) Schmidt" Date: Thu, 9 Feb 2017 15:40:35 -0800 Subject: [PATCH] "strictObjectIDCoercion": true on role-mapping.json How the json file is, loopback developers are currently unable to query RoleMappings by principalId, since most connectors (mongodb in my case) will overwrite the type of the principalId for the query to an ObjectId, which is incorrect behavior. principalId is a string, as per this definition. So having the query cast to an ObjectId always returns no matches. --- common/models/role-mapping.json | 1 + 1 file changed, 1 insertion(+) diff --git a/common/models/role-mapping.json b/common/models/role-mapping.json index 23c9d8abe..d59ef551e 100644 --- a/common/models/role-mapping.json +++ b/common/models/role-mapping.json @@ -1,6 +1,7 @@ { "name": "RoleMapping", "description": "Map principals to roles", + "strictObjectIDCoercion": true, "properties": { "id": { "type": "string",