{"id":13300752,"url":"https://github.com/wirgen/fastify-openapi-generator","last_synced_at":"2026-01-23T18:20:22.676Z","repository":{"id":35091330,"uuid":"205477331","full_name":"wirgen/fastify-openapi-generator","owner":"wirgen","description":"Generate API with fastify by OpenAPI specs","archived":false,"fork":false,"pushed_at":"2024-09-18T15:55:45.000Z","size":387,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-14T20:26:43.305Z","etag":null,"topics":["fastify","generator","openapi","swagger"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wirgen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2019-08-31T01:06:48.000Z","updated_at":"2022-07-22T05:03:16.000Z","dependencies_parsed_at":"2024-10-23T11:24:30.535Z","dependency_job_id":null,"html_url":"https://github.com/wirgen/fastify-openapi-generator","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/wirgen/fastify-openapi-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wirgen%2Ffastify-openapi-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wirgen%2Ffastify-openapi-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wirgen%2Ffastify-openapi-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wirgen%2Ffastify-openapi-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wirgen","download_url":"https://codeload.github.com/wirgen/fastify-openapi-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wirgen%2Ffastify-openapi-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28697428,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T17:25:48.045Z","status":"ssl_error","status_checked_at":"2026-01-23T17:25:47.153Z","response_time":59,"last_error":"SSL_read: 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","generator","openapi","swagger"],"created_at":"2024-07-29T17:43:04.190Z","updated_at":"2026-01-23T18:20:22.654Z","avatar_url":"https://github.com/wirgen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-openapi-generator\n\nFastify routes generator. Used [Swagger](https://swagger.io/) YAML specification. Supports schemas for describe models and validate response. \n\nSupports Fastify versions `\u003e=2.0.0`.\n\n\u003ca name=\"install\"\u003e\u003c/a\u003e\n## Install\n```shell script\nnpm i fastify-openapi-generator --save\n```\n\n\u003ca name=\"usage\"\u003e\u003c/a\u003e\n## Usage\nAdd it to your project with `register` and pass it some basic options, then call the `swagger` api and you are done!\n\n```JS\nconst fastify = require(\"fastify\")();\n\nfastify.register(require(\"fastify-openapi-generator\"), {\n  controllers: require(\"./controllers\"),\n  routeDocs: \"/docs/\",\n  yaml: \"swagger.yaml\",\n  template: \"swagger.html\",\n});\n```\n\n\u003ca name=\"api\"\u003e\u003c/a\u003e\n## API\n\n\u003ca name=\"register.options\"\u003e\u003c/a\u003e\n### register options\n\u003ca name=\"controllers\"\u003e\u003c/a\u003e\n#### controllers\nArray of handlers for fastify routes. Describe handlers in `operationId` with pattern `\u003ccontroller\u003e.\u003cfunction\u003e`. For example, you can collect all controllers from folder used `fs`:\n```js\nconst fs = require(\"fs\");\nconst path = require(\"path\");\nconst basename = path.basename(__filename);\n\nlet controllers = {};\nfs\n  .readdirSync(__dirname)\n  .filter(file =\u003e {\n    return (file.indexOf(\".\") !== 0) \u0026\u0026 file !== basename \u0026\u0026 (file.slice(-3) === \".js\");\n  })\n  .forEach(file =\u003e {\n    controllers[file.slice(0, -3)] = require(path.join(__dirname, file));\n  });\n\nmodule.exports = controllers;\n```\n\u003ca name=\"routedocs\"\u003e\u003c/a\u003e\n#### routeDocs\nPrefix for swagger documentation. By default, `/docs`. Also, you can get JSON (`/docs/json`) and YAML (`/docs/yaml`) files.\n\u003ca name=\"yaml\"\u003e\u003c/a\u003e\n#### yaml\nPath for swagger specification file in YAML. By default, `swagger.yaml`.\n\u003ca name=\"template\"\u003e\u003c/a\u003e\n#### template\nPath for custom html template for [Swagger](https://swagger.io/). As start point you can copy `swagger.html` from plugin.\n\n\u003ca name=\"security\"\u003e\u003c/a\u003e\n### Security\nGlobal security definitions and route level security provide documentation only. It does not implement authentication nor route security for you. Once your authentication is implemented, along with your defined security, users will be able to successfully authenticate and interact with your API using the user interfaces of the documentation.\n\n\u003ca name=\"license\"\u003e\u003c/a\u003e\n## License\n\nLicensed under [Apache 2.0](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwirgen%2Ffastify-openapi-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwirgen%2Ffastify-openapi-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwirgen%2Ffastify-openapi-generator/lists"}