icssc / anteater-api

API that provides easy access to public data from UC Irvine. Developed for Anteaters, by Anteaters.
https://anteaterapi.com/reference
GNU Affero General Public License v3.0
3 stars 0 forks source link

feat: properly type prerequisite tree #30

Closed ecxyzzy closed 1 week ago

ecxyzzy commented 1 week ago

Description

Revert prerequisiteTreeSchema to what it was originally. Also, override the OpenAPI metadata on it so it doesn't cause any errors, and set the metadata properly so consumers can receive the correct type data.

Honestly this was a lot less involved than I expected.

Related Issue

Closes #28.

Motivation and Context

Now we won't have to hardcode the prereq tree type in the API's consumers.

How Has This Been Tested?

type PrerequisiteTree = components["schemas"]["prereqTree"];



## Types of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->

- [ ] My code involves a change to the database schema.
- [ ] My code requires a change to the documentation.