Open SebaSOFT opened 2 years ago
I'm not following what the question is here.
Are you saying you'd expect the output to look like the code you posted? Or are you saying the output currently looks like the code you posted?
Sorry about my english and lack of clarity. I updated the OP to be more descriptive. Congratulations BTW as this project is a great plugin that allows for keeping the source project nice a tidy without Swagger UI's custom CSS/JS/HTML laying around
In what order are your serverless plugins?
If serverless-auto-swagger
is before serverless-http
, it would almost certainly need to come after it.
If you already have serverless-auto-swagger
after serverless-http
, I'm afraid this probably cannot be avoided, as serverless-auto-swagger
builds the swagger docs off of the serverless config supplied to it.
In what order are your serverless plugins?
If
serverless-auto-swagger
is beforeserverless-http
, it would almost certainly need to come after it.If you already have
serverless-auto-swagger
afterserverless-http
, I'm afraid this probably cannot be avoided, asserverless-auto-swagger
builds the swagger docs off of the serverless config supplied to it.
I've added my plugins list
Ah, yeah.. If serverless-http
is not a serverless plugin (and therefore would happen after serverless plugins are installed), then I don't know that there's any way to do what you're requesting.
Perhaps if we exposed a function to generate autoswagger via Node?
serverless-http
is not a plugin, but a handler to be invoked by the schema handler to generate a "final" lambda functions list. Autoswagger via node is always nice
Right, auto-swagger via node would probably be the only way to make what you're asking possible. I unfortunately don't have a lot of free time right now, but PRs are always welcome 😄
Currently the plugin does not support proxy installations with custom handlers. This is understandable but many templates for "express.js project for lambda functions" come with this feature built in. As the handler should be available for the plugin API I wanted to show my setup:
in my
serverless.yml
and then on
app.js
With this setup, the
sls generate-swagger
command will generate a json description that looks like this:But the expected result would be that the plugin generates a json that would be representative of the express app which is distributed in many files/folders for big APIs.
Tested with node/lambda