{"id":14971484,"url":"https://github.com/manju4ever/fastity-swagger-generate","last_synced_at":"2026-04-16T10:02:21.604Z","repository":{"id":64209673,"uuid":"475559400","full_name":"manju4ever/fastity-swagger-generate","owner":"manju4ever","description":"Generate Swagger or OpenAPI Specification (JSON/YML) for Fastify server routes without running the server","archived":false,"fork":false,"pushed_at":"2022-12-22T14:50:31.000Z","size":40,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-01T18:42:53.807Z","etag":null,"topics":["fastify","fastify-swagger","openapi-spec","swagger-api","swagger-docs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/manju4ever.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-03-29T17:56:37.000Z","updated_at":"2023-12-30T08:19:11.000Z","dependencies_parsed_at":"2023-01-30T11:45:16.535Z","dependency_job_id":null,"html_url":"https://github.com/manju4ever/fastity-swagger-generate","commit_stats":null,"previous_names":["manju4ever/fastify-swagger-generate"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/manju4ever/fastity-swagger-generate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manju4ever%2Ffastity-swagger-generate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manju4ever%2Ffastity-swagger-generate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manju4ever%2Ffastity-swagger-generate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manju4ever%2Ffastity-swagger-generate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/manju4ever","download_url":"https://codeload.github.com/manju4ever/fastity-swagger-generate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/manju4ever%2Ffastity-swagger-generate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31880884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-16T09:23:21.276Z","status":"ssl_error","status_checked_at":"2026-04-16T09:23:15.028Z","response_time":69,"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":["fastify","fastify-swagger","openapi-spec","swagger-api","swagger-docs"],"created_at":"2024-09-24T13:45:16.410Z","updated_at":"2026-04-16T10:02:21.575Z","avatar_url":"https://github.com/manju4ever.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-swagger-generate\n\nGenerate Swagger/OpenAPI definitions without running fastify app !\n\n\u003c!-- toc --\u003e\n\n- [fastify-swagger-generate](#fastify-swagger-generate)\n  - [Install](#install)\n  - [Disclaimer](#disclaimer)\n  - [Usage](#usage)\n  - [API](#api)\n    - [Options](#options)\n\n\u003c!-- tocstop --\u003e\n\n## Install\n\n`npm i fastify-swagger-generate`\n\n## Disclaimer\n\n- Only supports configuration based routes, i.e collection of route definitions\n- This library has no new content added\n- This library has just tweaked the original [fastify-swagger](https://github.com/fastify/fastify-swagger)\n\n## Usage\n\n1. Create a `generate.js` file which looks like\n\n```javascript\nconst fastifySwagGen = require(\"fastify-swagger-generate\");\nconst Routes = require(\"./routes\");\nconst opts = {};\n\n// generate swagger definitions\nfastifySwagGen(opts, Routes, (err, definitions) =\u003e {\n  // Write to a file\n  require(\"fs\")\n    .createWriteStream(\"./app.swag.json\")\n    .write(JSON.stringify(definitions));\n});\n```\n\n2. Let's say you have routes defined in `routes.js`\n\n```javascript\nconst routes = [\n  {\n    url: \"/users/:id\",\n    method: \"GET\",\n    schema: {\n      params: {\n        type: \"object\",\n        properties: {\n          id: {\n            type: \"number\",\n          },\n        },\n      },\n    },\n  },\n];\n\nmodule.exports = routes; // should be an iterable routes\n```\n\n## API\n\n### Options\n\n[Refer here for more](https://github.com/fastify/fastify-swagger#register-options)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanju4ever%2Ffastity-swagger-generate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanju4ever%2Ffastity-swagger-generate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanju4ever%2Ffastity-swagger-generate/lists"}