How to pass values of type Array in Postman

-1

I'm developing an API, and one of the modules is the ACL (access control list) in the Laravel Framework.

I came to a problem that I have not yet found plausible solutions, which is like testing values that get more than one parameter inside it.

In my case I'm creating Roles and in these Roles , when I create them, I need to pass the Permissions that it will have, in postman. In the current scenario I can only bind to a Permission .

I used these examples like this:

campo [1, 2, 3] campo {1, 2, 3} array[campo] 1,2,3

I want to register n permissions for that new Rule '.

    
asked by anonymous 23.11.2018 / 20:35

2 answers

0

Passing a campo[] but the values for each field that needs, in my case the permissions.

    
23.11.2018 / 20:58
1

Do not just send an array? Is your question about syntax? Use something like:

{
    "data": {
        "id": 49,
        "name": "Role 644",
        "label": "Role 453",
        "description": "Descrição da Role 258",
        "permissions": [{
            "id": 1,
            "name": "create_permission",
            "label": "Criar permissão",
            "created_at": null,
            "updated_at": null,
            "pivot": {
                "role_id": 49,
                "permission_id": 1
            }
        },{
            "id": 2,
            "name": "edit_permission",
            "label": "Editar permissão",
            "created_at": null,
            "updated_at": null,
            "pivot": {
                "role_id": 50,
                "permission_id": 2
            }
        }]
    }
}
    
23.11.2018 / 20:48