{"id":18084818,"url":"https://github.com/coderofsalvation/dpd-swagger-doc","last_synced_at":"2025-04-12T20:10:09.316Z","repository":{"id":57215803,"uuid":"73527855","full_name":"coderofsalvation/dpd-swagger-doc","owner":"coderofsalvation","description":"automatically generated apidocs from deployd resources","archived":false,"fork":false,"pushed_at":"2020-05-28T18:50:22.000Z","size":119,"stargazers_count":6,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-12T20:09:52.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/coderofsalvation.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"custom":"https://gumroad.com/l/hGYGh"}},"created_at":"2016-11-12T02:58:45.000Z","updated_at":"2021-01-07T23:56:07.000Z","dependencies_parsed_at":"2022-08-26T13:31:39.303Z","dependency_job_id":null,"html_url":"https://github.com/coderofsalvation/dpd-swagger-doc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fdpd-swagger-doc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fdpd-swagger-doc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fdpd-swagger-doc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderofsalvation%2Fdpd-swagger-doc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderofsalvation","download_url":"https://codeload.github.com/coderofsalvation/dpd-swagger-doc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625493,"owners_count":21135513,"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":[],"created_at":"2024-10-31T15:08:18.688Z","updated_at":"2025-04-12T20:10:09.288Z","avatar_url":"https://github.com/coderofsalvation.png","language":"JavaScript","funding_links":["https://gumroad.com/l/hGYGh"],"categories":[],"sub_categories":[],"readme":"generate beautiful online swagger docs based on your deployd resources\n\n\u003cimg src=\"https://github.com/coderofsalvation/dpd-swagger-doc/raw/master/screenshot.png\"/\u003e\n\n## Features\n\n* automatic documentation for Collection resources \n* automatic documentation for UserCollection resources \n* Custom/Collection/UserCollection-resources can be hinted in config.json\n\n## Usage: linux\n\n    $ cd your-deployd-dir\n    $ npm install dpd-event dpd-swagger-doc dpd-event-extension\n\nNow copy the swagger-resource and symlink the swaggerfolder:\n\n    $ cp -R node_modules/dpd-swagger-doc/resource resources/swagger\n    $ cp -R node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist public/apidoc\n\n\u003e Done! now try: http://localhost:2403/apidoc/?url=/swagger#!/default\n\n## Usage: windows/mac\n\n* npm install dpd-event dpd-swagger-doc dpd-event-extension\n* Copy : node_modules/dpd-swagger-doc/resource to resources/swagger\n* Create a folder in 'public' folder: 'apidoc'\n* Copy from: /node_modules/dpd-swagger-doc/node_modules/swagger-ui/dist to public/apidoc\n\n\u003e Done! now try http://localhost:2403/apidoc/?url=/swagger#!/default\n\n## Now what?\n\n* swagger json (should be) automatically generated at endpoint `/swagger`\n* surf to `http://localhost/apidoc/?url=/swagger#!/default` to see the generated docs \n* tweak `resource/swagger/get.js` at will\n\n## Hinting documentation \n\nSwagger will peek into your resource's `config.json` for swagger snippets.\nThis will allow you to extend the automatic documentation for (User)Collections.\nFor Custom resources however, you always need to  define them:\n\n    {\n      \"type\": \"Collection\",                \n      \"properties\": {\n        \"createdBy\": {\n            \"name\": \"createdBy\",\n            \"type\": \"string\",\n            \"typeLabel\": \"string\",\n            \"required\": false,\n            \"id\": \"createdBy\",\n            \"default\":\"username\",                     \u003c--  add this for autogenerated mock payloads \n            \"order\": 0\n        },\n\n        ....\n\n      }\n      \"swagger\":{                                     \u003c--\n        \"methods\":{                                   \u003c--\n          \"get\": {                                    \u003c-- this is where the swagger extending \n            \"public\":true,                            \u003c-- starts.. \n            \"description\": \"Creates a item\",          \u003c--\n            \"produces\": [ \"application/json\" ]        \u003c-- for more see swagger 2 specs or just\n          }                                           \u003c-- peek here: http://petstore.swagger.io/v2/swagger.json\n        }                                             \u003c--\n      }\n    }\n\n\u003e NOTE: it is not needed to specify get/post/put/delete sections, since they are automatically generated for \n\u003e\tUserCollections \u0026 Collections. However, as shown above you can overload them (just peek at the `/swagger`-output in your browser) \n\n#### Troubleshooting  (MAC)\n\n```\nError loading module node_modules/brace\nReferenceError: window is not define\n```\n\nPerform these steps below, on the Mac when you get the above error:\n1.npm uninstall brace\n2.npm uninstall fbjs\n3.npm uninstall lodash-es\n\n\u003e NOTE: It might throw some error on the console for certain functions and headers being missed. But it'll not be something to worry about.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fdpd-swagger-doc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderofsalvation%2Fdpd-swagger-doc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderofsalvation%2Fdpd-swagger-doc/lists"}