{"id":13494046,"url":"https://github.com/kminami/apib2swagger","last_synced_at":"2026-01-10T05:44:16.983Z","repository":{"id":26413955,"uuid":"29864061","full_name":"kminami/apib2swagger","owner":"kminami","description":"Convert API Blueprint to Swagger 2.0 or OpenAPI 3.0.","archived":false,"fork":false,"pushed_at":"2023-10-22T12:59:55.000Z","size":692,"stargazers_count":198,"open_issues_count":12,"forks_count":35,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-04-14T10:48:32.021Z","etag":null,"topics":["api-blueprint","swagger"],"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/kminami.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}},"created_at":"2015-01-26T14:18:34.000Z","updated_at":"2024-04-14T10:48:32.022Z","dependencies_parsed_at":"2024-01-16T09:52:53.064Z","dependency_job_id":"dcc6a77f-edb5-4e2e-8d00-d8aad433c0ee","html_url":"https://github.com/kminami/apib2swagger","commit_stats":{"total_commits":214,"total_committers":21,"mean_commits":10.19047619047619,"dds":0.7523364485981309,"last_synced_commit":"22678e5bcc5712d49135dee3cf5a24c429b3c6cb"},"previous_names":[],"tags_count":41,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kminami%2Fapib2swagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kminami%2Fapib2swagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kminami%2Fapib2swagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kminami%2Fapib2swagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kminami","download_url":"https://codeload.github.com/kminami/apib2swagger/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246037428,"owners_count":20713418,"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","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-blueprint","swagger"],"created_at":"2024-07-31T19:01:21.225Z","updated_at":"2026-01-10T05:44:16.942Z","avatar_url":"https://github.com/kminami.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# apib2swagger\n\n![Build Status](https://github.com/kminami/apib2swagger/actions/workflows/nodejs.yml/badge.svg)\n[![Coverage Status](https://coveralls.io/repos/github/kminami/apib2swagger/badge.svg?branch=master)](https://coveralls.io/github/kminami/apib2swagger?branch=master)\n[![npm version](https://badge.fury.io/js/apib2swagger.svg)](https://badge.fury.io/js/apib2swagger)\n\nConvert [API Blueprint](https://apiblueprint.org/) to [Swagger 2.0](http://swagger.io/) or [OpenAPI 3.0](https://github.com/OAI/OpenAPI-Specification).\n\nSupported versions:\n- API Blueprint 1A9\n    - [Metadata section](https://github.com/apiaryio/api-blueprint/blob/master/API%20Blueprint%20Specification.md#def-metadata-section)\n        - HOST -\u003e .host, .basePath, .schemes\n        - VERSION -\u003e .info.version\n    - [Include directive](https://github.com/danielgtaylor/aglio#including-files)\n- Swagger 2.0\n- OpenAPI 3.0.3\n- Node.js 18.x, 20.x or higher\n\n## Install\n\n```\n$ npm install -g apib2swagger\n```\n\n## Usage\n\nConvert to Swagger specification.\n```shell\n$ apib2swagger -i api.md\n$ apib2swagger -i api.md -o swagger.json\n$ apib2swagger -i api.md --yaml -o swagger.yaml\n$ apib2swagger -i api.md --prefer-reference\n$ apib2swagger -i api.md --bearer-apikey\n$ apib2swagger -i api.md --open-api-3\n$ apib2swagger -i api.md --info-title \"My API Document Title\"\n$ apib2swagger -i api.md --prefer-file-ref\n```\n\nWithout -i option it reads from STDIN, without -o option writes to STDOUT.\n```shell\n$ apib2swagger \u003c api.md \u003e swagger.json\n$ cat api.md | apib2swagger\n```\n\nRun http server with SwaggerUI.\nSwaggerUI will be automatically downloaded to current dir.\n```shell\n$ apib2swagger -i api.md -s\n$ apib2swagger -i api.md -s -p 3000\n\n# When using file references and running the SwaggerUI server, you can specify the source\n# directory with the -sd flag. It will check the input directory and execution directory\n# if -sd is not given.\n$ apib2swagger -i api.md -s --prefer-file-ref -sd ~/project/src/\n```\n\nUse as a library.\n```javascript\nvar apib2swagger = require('apib2swagger'),\n    apib = '...',\n    options = { \n        preferReference: true, \n\n        // optional (Swagger 2.0 only).\n        bearerAsApikey: false,\n\n        // optional. swagger 2.0 is used by default.\n        openApi3: true, \n\n        // optional. title will be grabbed from blueprint if not specified.\n        infoTitle: 'My API Document Title', \n\n        // optional (Open API 3 only). \n        // will set a $ref to the given file path instead of including the file contents.\n        preferFileRef: true \n    };\n\napib2swagger.convert(apib, options, function (error, result) {\n    if (!error) console.log(result.swagger);\n});\n```\n\n## npx\n\nYou can run apib2swagger via `npx` (without first needing to install it) like so:\n```\ncat api.md | npx apib2swagger \u003e swagger.json\n```\n\n## Docker\nYou can also run apib2swagger inside a docker container.\n\n```bash\n$ docker run -it --rm -v $(pwd):/docs ghcr.io/kminami/apib2swagger -i /docs/api.md -o /docs/swagger.json\n```\n\n## License\n\nCopyright (c) 2021 Keisuke Minami\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkminami%2Fapib2swagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkminami%2Fapib2swagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkminami%2Fapib2swagger/lists"}