-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement: Specify stages for excluding swagger endpoints #46
Comments
I would think you could already do that with something like Serverless 2.0.0: custom:
generateSwagger:
staging: true
development: true
prod: false
autoswagger:
generateSwaggerOnDeploy: ${{self:custom.generateSwagger.${{self:provider.stage}}}} Serverless 3.0.0: params:
default:
generateSwagger: false
staging:
generateSwagger: true
development:
generateSwagger: true
custom:
autoswagger:
generateSwaggerOnDeploy: ${param:generateSwagger} |
Would you mind checking and letting me know? |
Thanks for your quick response. P.S. I tested the above (Serverless 2.0) with config:
|
* feat: Only deploy swagger on specified stages (#46) * Refactor to excluded stages * update readme with excludeStages option * Update src/ServerlessAutoSwagger.ts Co-authored-by: Brandon Faulkner <[email protected]> * Update src/ServerlessAutoSwagger.ts Co-authored-by: Brandon Faulkner <[email protected]> Co-authored-by: jochem <[email protected]> Co-authored-by: Brandon Faulkner <[email protected]>
Did you found solution for deploy swagger on specified stages, I tried above comment But Did Not worked still deploying the swagger doc, Is there any way we can stop deploying swagger doc, while sls deploy. |
@sunilnalumachu please refer to the documentation rather than this thread for the final implementation. The config mentioned in your comment is not expected to work. See |
@bfaulk96 I tried that before but want to understand more on stages, like which params you support. I am currently using my local stage env in excludeStages array like this. can you give some examples what are the stages you exclude and can i use my local stage to exclude while sls deploy. |
@bfaulk96 So I think I'll temporarily use this workaround - #46 (comment) Edit: |
I'll look into updating that to support |
As of right now, swagger endpoints are always added. I want my swagger to only be generated and/or deployed when the stage is development or staging.
Suggestion:
The text was updated successfully, but these errors were encountered: