Automatic Documentation - Generate Swagger UI from your Serverless Config

preview_player
Показать описание
If you want to automatically generate documentation for your serverless project then you can use the "serverless-auto-swagger" to do just that.

`npm install -D serverless-auto-swagger`

If you want to have a text based version of this article then you can read it here.

If you want to look at the underlying code, want to submit a bug or issue, or even want to contribute then the link to the github is here:
Рекомендации по теме
Комментарии
Автор

In case the plugin deploys Swagger UI at a different host than your application's one. I figured out how to make the plugin deploy Swagger UI at the same host as your application. You most likely want to add apiType: 'http' to the plugin configuration section. It works for me. Additionally, don't forget to add basePath if you use a custom stage. Please rate the comment, so everyone else can see the possible solution for their headache.

pavelrazuvalau
Автор

thank you. I wanst understanding how to specify bodyType until your explanation

renatomoreira
Автор

Great work Sam.. Really Helpful.
I have one question: will it identify query parameters of the request?

febinr
Автор

Hi Sam!
This plugin was deprecated? I didn't see updates on npm...

veteranodilso
Автор

Awesome! I have question.
How can I specify the "Example Value" without using the default value of type??

chanyounglee
Автор

Do you have the source code for the project you ended up with? I have tried using the aws-nodejs-typescript starter, but it looks very different to your code. It seems to now use serverless-esbuild instead of serverless-webpack. Does serverless-auto-swagger work with serverless-esbuild?

alanschapira
Автор

Hi Sam great plugin!
But i am having a little issue here when I created a type file I tried to extend a class into a Interface but doesnt seems to work am I missing something?

johnsstudies
Автор

Hello, I'm trying to use the bodyType with an interface that extends properties from another interface. When swagger is loaded the model is not showing the proprieties from the extended interface. There's a way to fix this?

FelipeAvellaMoreira
Автор

Is there a way to agroup endpoints under a controller group? I was implementing it here and all endpoints got clustered in a single group, without separation by entity.
Thank you for the plugin!

leandrofita
Автор

Hi Sam,

When I set the responses object in http event function i'm receiving an error 500 (TypeError: Cannot destructure property 'responseParameters' of 'chosenResponse' as it is undefined.Ï)
when I try the endpoint in both postman and swagger.

When I comment the object the endpoint works.

Thanks in advance!

Sebasarra
Автор

I am getting this error
Failure: Cannot assign to read only property 'exports' of object '#<Object>'
Can anybody resolve this?

madhavkwatra
Автор

can you please share the github version of this project - also a video on serverless frameworkversion 3 migration is much needed, as the documentation sucks.

PrateekKumarS
Автор

Hey, Sam! For some reason my SwaggerUI and SwaggerJSON function names are returning undefined when deploying to AWS. Do you know why it can possibly happen?

eduupo
Автор

I'm getting below error when trying to serverless offline start
TypeError: is not a function

KoyaMel
Автор

Hello Sam,
I am trying to use serverless-auto-swagger along with serverless-bundle for a nodejs project. serverless-bundle seems to expect ES6 export import syntax, but the swagger src created are having commonJS require() syntax..could you pls guide me how can i use serverless-auto-swagger along with server-bundle plugin ?Im getting the follow error:

swagger-json.js
1:1 error 'use strict' is unnecessary inside of modules strict

ramyasaminathan
Автор

Hello Sam, Nice Plugin!
But I can't able to deploy to multiple environment, every time it is deploying to dev only. I'm getting Error:
CREATE_FAILED: SwaggerJSONLambdaFunction (AWS::Lambda::Function)
XXX-dev-swagger-json already exists in stack. Can you please help me!!

asishsam
Автор

Is there any one who has solved error at production level i am struggling with statusCode 406 please help.

saurav-sky
Автор

Hi,
I tried auto-swagger with serverless-esbuild and they are working as you mentioned in a comment. Thanks for that.
Could you please provide option not to deploy, so that we deploy the generated swagger files using our serverless.yml, which will deploy the docs in same url as our app and we can do Try-it-out in swagger page. Please correct me if i am wrong.

ramyasaminathan
Автор

Does this support 'serverless-http' for having `/{proxy}` functions to be read from the express router?

sebasoft
Автор

Awesome... I have a question, I have my end-points generated with /dev in the basepath as the dev stage when I run serverless locally. The swagger is getting generated, but the /dev is not getting appended in the URL, when I try try out, I'm getting 404 error. Request your help on this.

abhilashkokkonda