Find all genres in nested hierarchical format.

GET /api/v1/genres

Returns genres organized in a nested structure where parent genres contain their child genres. Parent genres are returned as top-level keys with their children nested inside.

Responses

  • 500 */*

    Internal Server Error

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 401 */*

    Unauthorized

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 404 */*

    Not Found

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 403 */*

    Forbidden

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 400 */*

    Bad Request

    Hide response attribute Show response attribute object
    • error object
      Hide error attributes Show error attributes object
      • code string
      • message string
      • target string
      • details array[object]
        Hide details attributes Show details attributes object
        • code string
        • message string
        • target string
  • 200 application/json

    Nested structure of genres with parent genres as keys and child genres nested inside.

    Hide response attribute Show response attribute object
    • parentGenres object
      Hide parentGenres attribute Show parentGenres attribute object
      • * object Additional properties
        Hide * attributes Show * attributes object
        • id string
        • name string
        • childGenres array[object]
          Hide childGenres attributes Show childGenres attributes object
          • id string
          • name string
GET /api/v1/genres
curl \
 --request GET 'http://localhost:8080/api/v1/genres'
Response examples (500)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (401)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (404)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (403)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (400)
{
  "error": {
    "code": "string",
    "message": "string",
    "target": "string",
    "details": [
      {
        "code": "string",
        "message": "string",
        "target": "string"
      }
    ]
  }
}
Response examples (200)
Nested Genres Example
{
  "parentGenres": {
    "Fiction": {
      "id": "1",
      "name": "Fiction",
      "childGenres": [
        {
          "id": "2",
          "name": "Science Fiction"
        },
        {
          "id": "3",
          "name": "Fantasy"
        }
      ]
    },
    "Non-Fiction": {
      "id": "4",
      "name": "Non-Fiction",
      "childGenres": [
        {
          "id": "5",
          "name": "Biography"
        }
      ]
    }
  }
}