serverless-aws-documentation
serverless-aws-documentation copied to clipboard
Documentation does not propagate `info`
The documentation clearly states that the version
and title
parameters of the info
block are not propagated to the output Swagger file. However, I noticed that I can't get any of the block to be propagated. This is an example serverless.yml:
service: test
provider:
name: aws
runtime: nodejs6.10
stage: ${opt:stage, 'development'}
region: eu-west-1
profile: ${self:provider.stage}
functions:
test:
handler: test.handler
events:
- http:
method: get
path: test
custom:
documentation:
info:
version: "0.0.1"
title: "Test API"
description: "Test everything"
termsOfService: "https://www.google.com"
contact:
name: "Jaap Haagmans"
And this is the output:
---
swagger: "2.0"
info:
version: "2018-04-23T15:30:42Z"
title: "production-test"
host: "###"
basePath: "/production"
schemes:
- "https"
paths:
/test:
get:
responses: {}
What am I doing wrong?
I'm seeing the same thing. custom.documentation.info.description
is not showing up, which is quite annoying.
I tried to fix this by creating a DocumentationPart resource with Type API, but I ran into these problems in CloudFormation:
https://forums.aws.amazon.com/thread.jspa?messageID=871765
Same here to me. All of parameter in custom.documentation.info
is ignored. What can I do?
@jhaagmans Any suggestions for alternatives?
Wow, I messed up. I've used 2 similar plugins, the other one is temando/serverless-openapi-documentation for which my previous comment was relevant (I removed the comment). This plugin is obviously not dead and unmaintained (unlike the other one), the problem mentioned here is not fixed though, but I'm not sure whether this is just a shortcoming in the API Gateway API or a bug in this plugin. I'm so sorry for the confusion, I got a notification and jumped the gun.
The documentation is incorrect. One needs to insert an extra api
level between documentation
and info
. See https://github.com/deliveryhero/serverless-aws-documentation/blob/master/example/serverless.yml#L23
So, for the example in the author's code snippet should change to...
custom:
documentation:
api:
info:
version: "0.0.1"
title: "Test API"
description: "Test everything"
termsOfService: "https://www.google.com"
contact:
name: "Jaap Haagmans"
@halprin Thanks!!!