{"id":15091542,"url":"https://github.com/grandlinex/docs-to-openapi","last_synced_at":"2025-10-06T11:30:31.600Z","repository":{"id":57114141,"uuid":"401494338","full_name":"GrandlineX/docs-to-openapi","owner":"GrandlineX","description":"This Project converts comments in your code or in your dependencies to an OpenApi Spec. ","archived":true,"fork":false,"pushed_at":"2021-09-16T19:39:32.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-07T15:46:13.072Z","etag":null,"topics":["documentation","grandlinex","openapi","openapi-specification","openapi3","swagger","swagger-ui","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GrandlineX.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}},"created_at":"2021-08-30T21:45:07.000Z","updated_at":"2023-06-17T23:58:13.000Z","dependencies_parsed_at":"2022-08-22T02:40:35.537Z","dependency_job_id":null,"html_url":"https://github.com/GrandlineX/docs-to-openapi","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/GrandlineX/docs-to-openapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandlineX%2Fdocs-to-openapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandlineX%2Fdocs-to-openapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandlineX%2Fdocs-to-openapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandlineX%2Fdocs-to-openapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrandlineX","download_url":"https://codeload.github.com/GrandlineX/docs-to-openapi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrandlineX%2Fdocs-to-openapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278601786,"owners_count":26013941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["documentation","grandlinex","openapi","openapi-specification","openapi3","swagger","swagger-ui","typescript"],"created_at":"2024-09-25T10:41:43.228Z","updated_at":"2025-10-06T11:30:31.283Z","avatar_url":"https://github.com/GrandlineX.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docs to OpenApi v.3\n\n## Documentation\n- [Docs](https://grandlinex.github.io/docs/utils/#docs-to-openapi-v3)\n\n\n[![GitHub](https://badge.fury.io/gh/GrandlineX%2Fdocs-to-openapi.svg)](https://github.com/GrandlineX/docs-to-openapi)\n[![NPM](https://img.shields.io/static/v1?label=NPM\u0026message=Package\u0026color=red\u0026logo=NPM)](https://www.npmjs.com/package/@grandlinex/docs-to-openapi)\n![TS](https://img.shields.io/static/v1?label=Language\u0026message=TypeScript\u0026color=blue\u0026logo=TypeScript)\n\n\n## Description\n\nThis Project converts comments in your code or in your dependencies to an OpenApi Spec.\nThe following annotations are supported. \n- `@openapi` \n- `@swagger`\n\nAll comments with these annotations will be pasted as a singe element in the path definition array.\nFor all other OpenApi configs the `glconf.json` is used.   \n\n## Installation\n\n- `npm i -g @grandlinex/docs-to-openapi` \n\n### Config fields\n\n- rootDir \n  - Relative path to your sourcecode.\n- filetypes \n  -  List of file extensions to monitor.\n- externalModules\n  - If your dependencies use also these annotations you can merge these in your curren spec.\n- outPutDir (optional)\n  - Relative path for the Spec. output.  \n\n## Quick Start\n\n1. Create a `glconf.json` in the root dir of your project (see config 01 or 02).\n2. Edit your base Config file like in the official [Swagger Doc](https://swagger.io/specification/)\n3. Add a Comment to your soruce code in yml syntax like: \n\n            /**\n             * @openapi\n             * /ping:\n             *   get:\n             *     summary: ping\n             *     tags:\n             *       - basic\n             *     responses:\n             *       200:\n             *         description: OK\n             *       401:\n             *         description: not authorized\n             */\n\n4. run `npx @grandlinex/docs-to-openapi`\n\n\u003e If you install the package as a dependency or global then you can use the `makeOpenApi` command. \n\n## CLI Parameter\n\n|Parameter|Description|\n|---|---|\n|`--html`|Creates a swagger.html file (Standalone SwaggerUI)|\n|`--serve`|Serves the OpenApi Spec on port 9000|\n\n\n## Config File Examples:\n\n### Config 01 `glconf.json` (minimal)\n\n\n      {\n        \"rootDir\": \"./src\",\n        \"filetypes\": [\"ts\",\"js\"],\n        \"externalModules\": [],\n        \"baseConfig\": {\n          \"info\": {\n            \"title\": \"Hello World\",\n            \"version\": \"1.0.0\",\n            \"description\": \"A sample API\"\n          },\n          \"servers\": [\n            {\n              \"url\": \"http://localhost:9257\"\n            }\n          ]\n        }\n      }\n\n### Config 02 `glconf.json` (Bearer JWT)\n\n      {\n        \"rootDir\": \"./src\",\n        \"filetypes\": [\"ts\",\"js\"],\n        \"externalModules\": [\"./node_modules/module_a\",\"./node_modules/module_b\"],\n        \"outPutDir\": \"./dist\",\n        \"baseConfig\": {\n          \"info\": {\n            \"title\": \"Hello World\",\n            \"version\": \"1.0.0\",\n            \"description\": \"A sample API\"\n          },\n          \"servers\": [\n            {\n              \"url\": \"http://localhost:9257\"\n            }\n          ],\n          \"security\": [\n            {\n              \"bearerAuth\": []\n            }\n          ],\n          \"components\": {\n            \"securitySchemes\": {\n              \"bearerAuth\": {\n                \"type\": \"http\",\n                \"scheme\": \"bearer\",\n                \"bearerFormat\": \"JWT\"\n              }\n            }\n          }\n        }\n      }\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrandlinex%2Fdocs-to-openapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrandlinex%2Fdocs-to-openapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrandlinex%2Fdocs-to-openapi/lists"}