Skip to content

Commit

Permalink
add example schema for Section
Browse files Browse the repository at this point in the history
  • Loading branch information
Highfire1 committed Jul 3, 2024
1 parent e120491 commit 43129ff
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sdk/schema/ScheduleEntry.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ class ScheduleEntry(SQLModel):
class Config:
json_schema_extra = {
"example": {
"id" : "SCHD-ENGL-1123-2024-10-10924-0",
"type" : "Lecture",
"days" : "M-W----",
"time" : "1030-1220",
"days" : "-T-R---",
"time" : "1530-1720",
"start": None,
"end" : None,
"room": "A136B",
"room": "A306",
"instructor": "Bob Ross"
}
}
Expand Down
24 changes: 24 additions & 0 deletions sdk/schema/Section.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,29 @@ class SectionAPI(SectionBase):

schedule: List["ScheduleEntryAPI"] = []

class Config:
json_schema_extra = {
"example": {
"id": "SECT-ENGL-1123-2024-10-10924",
"crn": 10924,
"RP": "P",
"seats": "4",
"waitlist": None,
"section": "001",
"credits": 3.0,
"abbreviated_title": "Intro to Academic Writing",
"add_fees": None,
"rpt_limit": 2,
"notes": None,
"subject": "ENGL",
"course_code": "1123",
"year": 2024,
"term": 10,
"schedule": [
ScheduleEntryAPI.Config.json_schema_extra["example"]
]
}
}

# course_id: Optional[str] = Field(default=None, foreign_key="sectiondb.id")
# course: Optional["CourseAPIExt"] = Relationship(back_populates="schedule")

0 comments on commit 43129ff

Please sign in to comment.