-
Notifications
You must be signed in to change notification settings - Fork 148
Skip all Documentation Parts overwriting in case of shared API Gateway usage. #121
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #121 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 8 8
Lines 437 453 +16
Branches 60 63 +3
=====================================
+ Hits 437 453 +16
Continue to review full report at Codecov.
|
Hey @YurgenUA, |
@tchock I added unit test to invoke code changes and return coverage to 100% back. |
Any plans of merging this? |
@tchock Can you please merge it and release a new version? |
If anyone is interested, the workaround is to clone repo with pull request and provide it as local serverless plugin, more details here: |
Another possible workaround is to reference git repository directly in project.json, like
both npm & yarn support it. Even specific git commit can be specified |
Hi! Willing to hand it over to someone who is willing to carry the torch. |
HI @sime If I can ask, what did you switch to? |
Our swagger is now auto generated from our application. |
tackling this problem: #106.
As of today plugin removes all doc-parts before deploying modified changed documentation. While this approach works ok in majority cases, it fails when API Gateway instance is reused by many sls deployments (and this scheme is more frequent approach as developers build more complicated APIs).
This PR introduce a piece of functionality which helped me to keep up with API documentation functionality having roughly dozen individual serverless.yml deploying under one API Gateway.
New function _isSharedApi() uses serverless.yml information to return if API is being deployed is in standalone mode (which are any deployment so far, since plugin correctly refreshed Documentation for that cases) or uses (shares) pre-existing API Gateway per https://serverless.com/framework/docs/providers/aws/events/apigateway#share-api-gateway-and-api-resources.
If deploying API is standalone, execution logic stays the same, i.e. all doc-parts removed and than recreated from deployment.
If deploying API is shared, only those doc-parts which belongs to current service (new property 'serverless-service' saved with each doc-part) removed and recreated. Thus, all other doc-parts, belonging to main service, or other dependent services are left untouched.