express-mongoose-es6-rest-api icon indicating copy to clipboard operation
express-mongoose-es6-rest-api copied to clipboard

Adding Automated Documentation via Optic

Open trulyronak opened this issue 5 years ago • 2 comments

Hi @kunalkapadia!

I really appreciated this boilerplate you built - JWT is often implemented really confusingly but your implementation made it super straightforward and nice.

I've been contributing to the Optic Project and helped write integration guides on how you can use it on various API frameworks in the past, and wanted to go a step further by PR-ing my work into awesome boilerplates. When I started using this boilerplate, I added Optic early on, and thought it'd be really useful to contribute back and add auto docs to the project.

Did I implement this correctly? Would love to add this feature!

Key Changes

  • added 4 new scripts to package.json
    • npm run api-install installs the Optic Client
    • npm run api-diff runs your API with the Optic proxy, and monitors changes to the api (this lets you document changes you might have made, updating the documentation without having to manually write OpenAPI specifications)
    • npm run api-docs opens up the current documentation for the api
    • npm run generate-openapi generates a OpenAPI spec for the user to use
  • Modified config/config.js to look for the OPTIC_API_PORT (this enables optic to run) - this won't stop you from running the api like normal via npm start)

trulyronak avatar Jun 29 '20 19:06 trulyronak

Pull Request Test Coverage Report for Build 1103

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.05%) to 93.333%

Totals Coverage Status
Change from base Build 1102: 0.05%
Covered Lines: 229
Relevant Lines: 239

💛 - Coveralls

coveralls avatar Jun 29 '20 19:06 coveralls

Update: Resolved via #465

Screen Shot 2020-06-29 at 1 20 22 PM

trulyronak avatar Jun 29 '20 20:06 trulyronak