found a potential "bug" / typo in node sdk. I'm w...
# permit-saas
e
found a potential "bug" / typo in node sdk. I'm working with bulk unassign, def:
Copy code
export interface RoleAssignmentRemove {
    /**
     * the role that will be unassigned (accepts either the role id or the role key)
     * @type {string}
     * @memberof RoleAssignmentRemove
     */
    role: string;
    /**
     * the tenant the role is associated with (accepts either the tenant id or the tenant key)
     * @type {string}
     * @memberof RoleAssignmentRemove
     */
    tenant?: string;
    /**
     * the resource instance the role is associated with (accepts either the resource instance id or key using this format resource_type:resource_instance)
     * @type {string}
     * @memberof RoleAssignmentRemove
     */
    resource_instance?: string;
    /**
     * the user the role will be unassigned from (accepts either the user id or the user key)
     * @type {string}
     * @memberof RoleAssignmentRemove
     */
    user: string;
}
but when I make the actual api call, its stating that
tenant
is NOT optional
a
Hi @Engineering Swantide, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
You're right to notice this inconsistency. Looking at the Node.js SDK type definition for
RoleAssignmentRemove
, the
tenant
field is indeed marked as optional with
tenant?: string
(1) . However, it appears the API itself requires this field. For comparison, in other SDKs like Java, the
tenant
field is not optional in the
RoleAssignmentRemove
class (2) , and in the Go SDK,
tenant
is also a required field (3) . This suggests there may be a type definition mismatch in the Node.js SDK where the TypeScript interface incorrectly marks
tenant
as optional when the underlying API requires it. To help our engineers investigate this issue: 1. Which Workspace / Project / Environment are you using? 2. Can you share the exact SDK code or CURL request you're making for the bulk unassign? 3. Which PDP version are you running? 4. Could you share the relevant error logs from your PDP when this fails? This information will help us confirm and address the type definition inconsistency.
a
Hey @Engineering Swantide , thanks for reaching out, will circle back to you soon!