-
Notifications
You must be signed in to change notification settings - Fork 3
Faculty APIs #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
gerardomaruotti
wants to merge
26
commits into
polito:master
Choose a base branch
from
gerardomaruotti:feature/faculty-api
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Faculty APIs #66
gerardomaruotti
wants to merge
26
commits into
polito:master
from
gerardomaruotti:feature/faculty-api
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Branch guide (feature/faculty-api vs master)
High-level changes
openapi.yamlremoved from version control and replaced by a multi-file source tree undersrc/; bundled file is now generated locally and gitignored./v2/coursesis superseded by/courses;/departmentsis removed.x-tagGroupsto improve Swagger UI navigation.Repository structure (new vs master)
src/index.yamlis the entry point that bundles all paths/components; it enumerates every path via$ref.src/paths/now holds consumer-specific trees:common/: auth, profile (me/deadlines/messages/notifications/preferences), news, places (/v2/placesplus new/v2/places/bookingsupsert/fetch), emergencies, faults, people, bookings, courses (including nested lectures/notices/files/assignments/videolectures), guides.students/: auth career switch, student profile, exams (booking/reschedule), lectures feed, ESC, tickets (topics/FAQ/thread CRUD), job offers, offering, surveys.faculty/: profile (self update, publications), exams (list/detail/notify/add student), courses (list students/collaborators, message students), digital signature flows (documents, sessions, OTP verify/sign), calendar (calendars/events CRUD and materials).src/components/split by concern:schemas/common.yaml: shared domain (auth/login, bookings, places, emergency, faults, news, people, notifications, course material, place booking upsert, errors, etc.).schemas/students.yaml: student-facing models (student profile, grades/provisional grades, deadlines, lectures, virtual classrooms, tickets, job offers, offering, surveys).schemas/faculty.yaml: faculty models (course students/collaborators, course lectures/notices/materials, exams/enrollments, calendar/event/materials, publications, signing session/documents/OTP).responses.yaml: standardized errors plus signing-specific responses (invalid OTP, session expired, too many attempts, precondition failed).parameters.yaml: reusable path/query/header params (course/exam/student IDs, pagination, place filters, signing session/document IDs, fault ID, etc.).security-schemes.yaml: bearerAuth definition.openapi.yaml,node_modules/,typescript-fetch-client/,.openapi-generator/, with.openapi-generator-ignoretrimming generator artifacts (tests, git metadata).Tooling and scripts introduced
package.json(tracked) with npm scripts:bundle:swagger-cli bundle src/index.yaml -o openapi.yaml -t yaml.validate:swagger-cli validate openapi.yaml.bundle:verify: runs bundle then validate.generate:client: bundles and runsopenapi-generator-cli(typescript-fetch, version 7.4.0, package name@polito/api-client, version 1.0.0) intotypescript-fetch-client/.generate:client:fix: runs client generation thenfix:client.fix:client: prepends// @ts-nocheckto the generated runtime and (conditionally)FeatureAllOfId.tsto work around generator typings.openapitools.jsonpins the generator CLI schema/version (7.4.0) for reproducible client builds.package-lock.jsonadded for the Node toolchain (swagger-cli,@openapitools/openapi-generator-cli).CI/CD updates
.github/workflows/validate-openapi.ymlruns on PRs tomaster: checkout, Node 18 setup,npm ci,npm run bundle,npm run validate, install globalopenapi-generator-cli, and validate the bundle again.npm config set registry(instead ofregistry-urlinsetup-node).API surface delta highlights
/emergencies(+contacts/detail) and/faultsCRUD; extended places with/v2/places/bookingsupsert/fetch and location filters; course resources gain lecture-detail routes and notice IDs./faculty/me+ publications), exams (list/detail/notify/add student), courses (list/enroll students, manage collaborators, message class), digital signature (documents/sessions/OTP verification/sign), and calendar (calendars/events CRUD, materials)./departmentsendpoint;/v2/coursesreplaced by/coursesequivalents.Working with the branch
npm run bundle:verify; the bundle stays inopenapi.yaml(gitignored) for tooling or mock servers.npm run generate:client:fixif you need SDK updates (keeps// @ts-nocheckpatch applied).docker-compose upto preview the bundled spec in swagger-ui on port 8080.