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)
I found a few issues while testing the higher-year timetable endpoints.
1.
slots.mapcrashes for some timetablesEndpoint
The request fails with:
The parser currently assumes every period is an array of concurrent slot lists:
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
Response:
{ "error": "An error occurred while fetching timetable data" }3. Branch enum in OpenAPI documentation
The branch mappings are currently defined internally:
However, these aliases are not properly reflected in the generated OpenAPI schema.
The OpenAPI documentation should explicitly define the allowed enum values so that:
Ideally, the schema should expose something like:
instead of relying solely on the internal lookup object to
GET /openapiOriginally posted by @aumanshkaushal in #4 (comment)