{"id":47881693,"url":"https://github.com/patriciasegantine/open-api-swagger","last_synced_at":"2026-04-04T01:49:41.265Z","repository":{"id":347293504,"uuid":"1193135510","full_name":"patriciasegantine/open-api-swagger","owner":"patriciasegantine","description":"A Fastify + TypeScript REST API exploring OpenAPI documentation with TypeBox schema validation and Scalar interactive docs.","archived":false,"fork":false,"pushed_at":"2026-03-29T10:54:55.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T01:49:10.443Z","etag":null,"topics":["api-docs","fastify","nodejs","openai-api","rest-api","scalar","swagger","typebox","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patriciasegantine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-26T23:01:06.000Z","updated_at":"2026-03-29T10:58:50.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/patriciasegantine/open-api-swagger","commit_stats":null,"previous_names":["patriciasegantine/open-api-swagger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/patriciasegantine/open-api-swagger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciasegantine%2Fopen-api-swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciasegantine%2Fopen-api-swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciasegantine%2Fopen-api-swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciasegantine%2Fopen-api-swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patriciasegantine","download_url":"https://codeload.github.com/patriciasegantine/open-api-swagger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patriciasegantine%2Fopen-api-swagger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31384846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T01:22:39.193Z","status":"ssl_error","status_checked_at":"2026-04-04T01:22:33.970Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-docs","fastify","nodejs","openai-api","rest-api","scalar","swagger","typebox","typescript"],"created_at":"2026-04-04T01:49:40.683Z","updated_at":"2026-04-04T01:49:41.252Z","avatar_url":"https://github.com/patriciasegantine.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenAI API Exploration with Fastify\n\n---\n\nA simple project built to explore the OpenAI API using Fastify, TypeScript, and OpenAPI documentation.\n\n![Project preview](./assets/post-user.png)\n\n\u003e The idea was to keep the project intentionally small and use it as a practical way to experiment with the API, its responses, and the overall developer experience.\n\n---\n\n## Stack\n\n- Node.js\n- TypeScript\n- Fastify\n- @sinclair/typebox\n- @fastify/type-provider-typebox\n- @fastify/swagger\n- @scalar/fastify-api-reference\n- @fastify/cors\n\n## What’s included\n\n- Fastify server with TypeBox type provider\n- Automatic OpenAPI schema generation from TypeBox schemas\n- Full TypeScript type inference in route handlers\n- Interactive API documentation with Scalar\n- CORS support\n- Sample `/users` endpoints (GET, POST, and GET by ID)\n\n## Getting started\n\nInstall dependencies:\n\n```bash\nnpm install\n```\nRun the development server:\n\n```bash\nnpm run dev\n```\nThe app runs at:\n\n```plaintext\nhttp://localhost:3333\n```\n\n## API documentation\n\nOpenAPI JSON:\n```plaintext\nhttp://localhost:3333/openapi.json\n```\nInteractive docs (Scalar):\n```plaintext\nhttp://localhost:3333/docs\n```\n## Endpoints\n\n### GET /users\n\nReturns a paginated list of users.\n\n**Query parameters**\n\n| Parameter | Type | Default | Description |\n|---|---|---|---|\n| `page` | integer | `1` | Page number (min: 1) |\n| `pageSize` | integer | `10` | Items per page (min: 1) |\n\n\n**Example response**\n\n```json\n{\n  \"total\": 1,\n  \"page\": 1,\n  \"pageSize\": 10,\n  \"data\": [\n    {\n      \"id\": \"a3bb189e-8bf9-3888-9912-ace4e6543002\",\n      \"name\": \"Alice\",\n      \"email\": \"alice@example.com\"\n    }\n  ]\n}\n```\n\n### POST /users\n\nCreates a new user. Requires Bearer token authentication.\n\n**Request body**\n\n```json\n{\n  \"name\": \"Alice\",\n  \"email\": \"alice@example.com\"\n}\n```\n**Responses**\n\n| Status | Description |\n|---|---|\n| `201` | User created successfully |\n| `400` | Validation error |\n| `409` | Email already exists |\n\n### GET /users/:id\n\nReturns a single user by their UUID.\n\n**Path parameters**\n\n| Parameter | Type | Description |\n|---|---|---|\n| `id` | string (uuid) | The user's unique identifier |\n\n**Responses**\n\n| Status | Description |\n|---|---|\n| `200` | User found |\n| `404` | User not found |\n\n**Example response**\n\n```json\n{\n  \"id\": \"a3bb189e-8bf9-3888-9912-ace4e6543002\",\n  \"name\": \"Alice\",\n  \"email\": \"alice@example.com\"\n}\n```\n\n---\n\n\u003e ## Notes\n\u003e Schemas are defined with TypeBox — a single source of truth for validation, TypeScript types, and OpenAPI documentation. No separate spec file needed.\n\n---\n\n### Licence\n\nISC\n\n---\n\n## 👩‍💻 Author\n\nCreated by **Patricia Segantine**  \nSenior Frontend Engineer | Exploring backend development\n\n🔗 GitHub: [@patriciasegantine](https://github.com/patriciasegantine)  \n🔗 LinkedIn: [Patricia Segantine](https://www.linkedin.com/in/patriciasegantine/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatriciasegantine%2Fopen-api-swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatriciasegantine%2Fopen-api-swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatriciasegantine%2Fopen-api-swagger/lists"}