deliveryhero / serverless-aws-documentation

Serverless 1.0 plugin to add documentation and models to the serverless generated API Gateway
MIT License
310 stars 148 forks source link

Warn when `custom.documentation` does not exist #144

Open ghost opened 4 years ago

ghost commented 4 years ago

There can be two things that can cause downloadDocumentation to fail which may lead to cryptic errors:

  1. No deploy was done, meaning that the REST API ID won't show up in the CFN stack.
  2. The custom.documentation key wasn't set, meaning that it'll also not show up in the CFN stack.

IMHO, we should error when this key doesn't exist in serverless.yml and downloadDocumentation is called, and additionally mention that you should deploy the docs before calling downloadDocumentation.