byte-it / openapi-spec-generator

Creates Open API spec for a Laravel JSON:API
3 stars 6 forks source link

Fix a wrongly generated doc for to many relations #14

Open Rocksheep opened 3 years ago

Rocksheep commented 3 years ago

When a relation what specified as a to many relationship it would generate a wrong documentation for the detach endpoint. Before my fix it expected an object instead of an array.

Before this fix:

{
    "data": {
        "type": "tags",
        "id": "<string>"
    }
}

After this fix:

{
    "data": [
        {
            "type": "tags",
            "id": "<string>"
        },
        {
            "type": "tags",
            "id": "<string>"
        }
    ]
}