https://github.com/derekahn/swaggen
š¤Swagger code generator for organized and maintainable swagger documentations.
https://github.com/derekahn/swaggen
code-generator documentation-tool node swagger
Last synced: 2 months ago
JSON representation
š¤Swagger code generator for organized and maintainable swagger documentations.
- Host: GitHub
- URL: https://github.com/derekahn/swaggen
- Owner: derekahn
- License: mit
- Created: 2018-08-13T18:34:02.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T20:36:17.000Z (over 3 years ago)
- Last Synced: 2025-03-29T11:36:00.379Z (over 1 year ago)
- Topics: code-generator, documentation-tool, node, swagger
- Language: JavaScript
- Homepage:
- Size: 167 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Swaggen
Swagger code generator for organized and maintainable swagger documentations.
## Example ping.doc.js (copy pasta):
```javascript
const tags = [
{
name: 'ping',
description: 'ping the world',
},
];
const paths = {
ping: {
get: {
summary: 'A simple GET to our example app',
description: '/ping returns a string',
tags: ['ping'],
produces: ['application/json'],
parameters: [],
responses: {
200: {
description: 'Successful GET',
schema: {
type: 'object',
properties: {
foo: {
type: 'string',
example: 'hello š',
},
bar: {
type: 'integer',
example: 55,
},
baz: {
type: 'boolean',
example: true,
},
},
},
},
},
},
},
};
const definitions = {};
module.exports = { tags, paths, definitions };
```
## Usage:
```shell
$ yarn; cd example && yarn;
# in root of swaggen/
$ yarn docs route=example/routes/ping
# copy the example config above ā
$ vim example/routes/ping/docs/ping.doc.js
# start example app and go to localhost:8080/swagger
$ cd example/ && yarn start
```
## TODO
* [ ] convert to NPM š¦