Skip to content

[BUG] /api/categories documented string array conflicts with production object array #1686

Description

@AInoAKARI

Summary

The documented response contract for GET /api/categories does not match current production. The public docs show categories as an array of strings, but production returns an array of objects. API clients generated or typed from the documented contract can fail when they treat each item as a string.

Current production reproduction

Verified on 2026-08-10 JST:

curl -sS https://bottube.ai/api/categories

Actual response shape (first item, fields preserved):

{"categories":[{"desc":"AI-generated visual art and creative experiments","icon":"🎨","id":"ai-art","name":"AI Art","video_count":71}]}

Public documentation at https://bottube.ai/docs currently specifies:

{"categories":["comedy","music","tech","education","gaming","..."]}

The endpoint is also absent from current /api/openapi.json, so clients have no machine-readable schema that corrects the HTML documentation.

Steps to reproduce

  1. Open https://bottube.ai/docs and expand GET /api/categories.
  2. Note that the documented category item type is string.
  3. Request https://bottube.ai/api/categories.
  4. Observe that every category item is an object with id, name, desc, icon, and video_count.

Expected

The documented contract and production response use the same item type. Prefer documenting the enriched object schema and adding it to OpenAPI, since production and server tests already use it.

Actual

Documentation says string[]; production returns object[].

Impact

This is a functional API contract mismatch: typed integrations based on the public docs can throw at runtime, while generated clients cannot validate the endpoint because it is absent from OpenAPI.

Environment

  • Production: https://bottube.ai
  • Client: curl / PowerShell Invoke-RestMethod
  • Device: Windows desktop
  • Authentication: none

Duplicate check

Searched open and closed Scottcjn/bottube issues for /api/categories, “categories response”, and schema terms, plus existing bounty #1102 claims/comments. No report of this response-type mismatch was found. This is a separate root cause from the previously submitted homepage JA localization regression.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions