Skip to content

I found a few issues while testing the higher-year timetable endpoints. #5

Description

@kanithi01karthik

I found a few issues while testing the higher-year timetable endpoints.

1. slots.map crashes for some timetables

Endpoint

GET /timetable/year/2?branch=CSE

The request fails with:

TypeError: slots.map is not a function

The parser currently assumes every period is an array of concurrent slot lists:

structuredTimetable[day][periodName] = slots.map(...)

However, some timetable data appears to have a different structure (or a single object instead of an array), causing the parser to crash.


2. Some branches return a generic error

Example

GET /timetable/year/2?branch=CHE

Response:

{
  "error": "An error occurred while fetching timetable data"
}

3. Branch enum in OpenAPI documentation

The branch mappings are currently defined internally:

CSE
CS
IT
ECE
EC
EE
ME
CE
BT
CH
CHE
ICE
IPE
TT
MNC
MC

However, these aliases are not properly reflected in the generated OpenAPI schema.

The OpenAPI documentation should explicitly define the allowed enum values so that:

  • Swagger UI shows all supported branches.
  • Client SDKs are generated correctly.
  • Future contributors have a single source of truth.
  • Validation and documentation remain consistent.

Ideally, the schema should expose something like:

enum: [
  "CSE",
  "CS",
  "IT",
  "ECE",
  "EC",
  "EE",
  "ME",
  "CE",
  "BT",
  "CH",
  "CHE",
  "ICE",
  "IPE",
  "TT",
  "MNC",
  "MC",
]

instead of relying solely on the internal lookup object to GET /openapi

Originally posted by @aumanshkaushal in #4 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions