ruby-auth0: Missing to_json for delete_with_body

Issue

When using #remove_role_permissions, I get:

warning: Overriding "Content-Type" header "application/json" with "application/x-www-form-urlencoded" due to payload
Auth0::BadRequest: {"statusCode":400,"error":"Bad Request","message":"Payload validation error: 'Expected type string but found type array' on property permissions[0].resource_server_identifier (The resource server that the permission is attached to). (also) Payload validation error: 'Expected type string but found type array' on property permissions[0].permission_name (The name of the permission to perform the action).","errorCode":"invalid_body"}

even though my array looks fine to me:

[
    [0] #<Struct:Permission:0x5586cd6267a0
        permission_name = "users:read:co_members",
        resource_server_identifier = "https://xxx/v1/"
    >,
    [1] #<Struct:Permission:0x5586cd626688
        permission_name = "users:read:current_user",
        resource_server_identifier = "https://xxx/v1/"
    >
]

Fix

In my understanding, it is due to the fact that this line uses body instead of body.to_json.

That would be an easy fix if it’s ok.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 15 (14 by maintainers)

Most upvoted comments

@pebneter @MicMicMon - thanks for checking back in here. We’ll make sure to address this in the next release 👍