Api platform json:api request/response schema in api/docs

21 Views Asked by At

Is there a way to get in API documentation of the Api platform full json:api support to display request and response preview of the route request? At the moment only basic json preview is available.

Did someone succeeded to create custom schema for json:api?

I am expecting to get something like this:

{
  "data": {
    "id": "/api/categories/1",
    "type": "CategoryReadModel",
    "attributes": {
      "_id": "1",
      "name": "aa",
      "rightKey": 1
    },
    "relationships": {
      "contentItemCategories": {
        "data": [
          {
            "type": "ContentItemCategoryReadModel",
            "id": "/api/content-item-categories/1"
          },
          {
            "type": "ContentItemCategoryReadModel",
            "id": "/api/content-item-categories/2"
          }
        ]
      }
    }
  },
  "included": [
    {
      "id": "/api/content-item-categories/1",
      "type": "ContentItemCategoryReadModel",
      "attributes": {
        "_id": "1",
        "categoryCode": "aa",
        "createdAt": "2024-03-25T07:23:40+00:00",
        "modifiedAt": "2024-03-25T07:23:40+00:00"
      }
    },
    {
      "id": "/api/content-item-categories/2",
      "type": "ContentItemCategoryReadModel",
      "attributes": {
        "_id": "2",
        "categoryCode": "aa",
        "createdAt": "2024-03-25T07:23:40+00:00",
        "modifiedAt": "2024-03-25T07:23:40+00:00"
      }
    }
  ]
}
0

There are 0 best solutions below