-
Notifications
You must be signed in to change notification settings - Fork 3
Switch to TypeSpec #68
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
base: master
Are you sure you want to change the base?
Conversation
e29d1cf to
e4bc246
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a comprehensive migration from a hand-written OpenAPI specification to a TypeSpec-based API definition for the Politecnico di Torino Students API. The migration establishes a structured project with source-controlled TypeSpec files that compile to OpenAPI 3.0, along with automated tooling for code generation, validation, and client SDK publishing.
Key changes:
- Complete TypeSpec specification covering 13 API domains (auth, bookings, courses, exams, students, etc.)
- Automated CI/CD workflows for linting, compilation, and TypeScript client generation
- Developer tooling configuration (VSCode settings, formatting, Node.js version management)
Reviewed changes
Copilot reviewed 37 out of 40 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tspconfig.yaml | TypeSpec compiler configuration for OpenAPI 3 emission |
| package.json | Project dependencies, build scripts, and npm configuration |
| openapitools.json | OpenAPI Generator settings for TypeScript client generation |
| .nvmrc | Node.js version pinning (v20.19.6) |
| .github/workflows/checks.yml | CI workflow for linting, compilation, and OpenAPI validation |
| .github/workflows/publish-client.yml | Publishing workflow for generated TypeScript client |
| .vscode/settings.json | VSCode workspace settings enabling format-on-save |
| .vscode/extensions.json | Recommended TypeSpec VSCode extension |
| src/main.tsp | Main API service definition with metadata and route imports |
| src/version.tsp | API version constant definition |
| src/common.tsp | Shared models, response aliases, and error types |
| src/routes/auth.tsp | Authentication endpoints (login, MFA, service links) |
| src/routes/bookings.tsp | Booking management endpoints and models |
| src/routes/courses.tsp | Course operations including files, assignments, and lectures |
| src/routes/esc.tsp | European Student Card management endpoints |
| src/routes/exams.tsp | Exam booking and management operations |
| src/routes/job-offers.tsp | Job offer listing and detail endpoints |
| src/routes/news.tsp | News item retrieval operations |
| src/routes/offering.tsp | Academic offering and degree program endpoints |
| src/routes/people.tsp | People search and profile endpoints |
| src/routes/places.tsp | Place, building, and site management operations |
| src/routes/student.tsp | Student profile, grades, messages, and notifications |
| src/routes/surveys.tsp | Survey listing endpoints |
| src/routes/tickets.tsp | Support ticket management system |
| src/examples/*.tsp | Example data constants for all route definitions |
| .github/copilot-instructions.md | Comprehensive developer guide for TypeSpec patterns and conventions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
902cc9f to
018db0a
Compare
This pull request introduces a comprehensive initial setup for the Polito Students API TypeSpec project. It establishes the project structure, core API models, routes, and supporting developer tooling. The most important changes include the addition of foundational TypeSpec source files for the API, configuration for code generation and publishing, and improvements to the developer workflow through linting, formatting, and recommended extensions.
API Definition and Structure:
src/common.tsp.src/main.tsp, importing all route files and setting up OpenAPI integration.src/routes/auth.tsp) and bookings (src/routes/bookings.tsp). [1] [2]src/examples/courses.tsp.Build, Linting, and Automation:
.github/workflows/checks.yml) to enforce code quality, linting, compilation, and OpenAPI generation on pull requests and pushes..github/workflows/publish-client.yml) to build and publish the generated TypeScript client using Node.js and Java, aligning with the new build process.openapitools.jsonto configure OpenAPI code generation, output directory, and generator options.package.jsonwith scripts for compiling, formatting, building, and generating the client, as well as managing dependencies..nvmrcfor consistent environment setup.Developer Experience Enhancements:
These changes lay the groundwork for further API development, client generation, and streamlined team collaboration.