{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/certifyos/main/json-schema/certifyos-user-list-response-with-roles-dto-schema.json",
  "title": "UserListResponseWithRolesDto",
  "description": "Paginated list of users with roles",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/certifyos-user-api-openapi.yml#/components/schemas/UserListResponseWithRolesDto",
  "type": "object",
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/UserResponseWithRolesDto"
      },
      "description": "List of users with roles"
    },
    "totalCount": {
      "type": "integer",
      "format": "int64",
      "description": "Total number of users"
    },
    "links": {
      "$ref": "#/$defs/PageLinks",
      "type": "object",
      "description": "Pagination links"
    }
  },
  "$defs": {
    "OffsetDateTime": {
      "type": "string",
      "format": "date-time"
    },
    "PageLinks": {
      "type": "object",
      "description": "HATEOAS-style pagination links.",
      "properties": {
        "self": {
          "type": "string",
          "description": "Link to the current page."
        },
        "next": {
          "type": "string",
          "description": "Link to the next page; null on the last page."
        },
        "prev": {
          "type": "string",
          "description": "Link to the previous page; null on the first page."
        }
      }
    },
    "RoleDetails": {
      "type": "object",
      "description": "Role details with full role information",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "tenantId": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/OffsetDateTime"
        },
        "createdBy": {
          "type": "string"
        },
        "updatedAt": {
          "$ref": "#/$defs/OffsetDateTime"
        },
        "updatedBy": {
          "type": "string"
        }
      }
    },
    "UserResponseWithRolesDto": {
      "type": "object",
      "description": "User response with roles included",
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "firstName": {
          "type": "string"
        },
        "lastName": {
          "type": "string"
        },
        "tenantId": {
          "type": "string"
        },
        "createdAt": {
          "$ref": "#/$defs/OffsetDateTime"
        },
        "updatedAt": {
          "$ref": "#/$defs/OffsetDateTime"
        },
        "createdBy": {
          "type": "string"
        },
        "updatedBy": {
          "type": "string"
        },
        "roles": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/RoleDetails"
          },
          "description": "List of roles assigned to the user"
        }
      }
    }
  }
}