I have two http methods on the same url /api/v1/environment/{id} get and put
I deploy and then pull down the documentation
sls downloadDocumentation --outputFileName=apiDoc.json
The definition of the get is there but the put definition is only
"put" : {
"responses" : { }
}
Here are the parts of my yaml
functions:
updateEnvironment:
handler: controllers/api/v1/environments.updateEnvironment
environment:
myURL: ${self:custom.mongoConnectionString.${self:provider.stage}}
events:
- http:
path: api/v1/environments/{id}
method: put
documentation: ${self:custom.environmentsAPI.endpoints.updateEnvironment}
getEnvironment:
handler: controllers/api/v1/environments.getEnvironment
environment:
myURL: ${self:custom.mongoConnectionString.${self:provider.stage}}
events:
- http:
path: api/v1/environments/{id}
method: get
documentation: ${self:custom.environmentsAPI.endpoints.getEnvironment}
Here is the documentation section
getEnvironment:
summary: Get A Single Environment
description: >
Method to get a single Environment
pathParams:
- name: "id"
description: "The ID of the environment that you want to retrieve"
schema:
type: "string"
required: true
requestHeaders:
- ${self:custom.standardParams.X-Request-Id}
- ${self:custom.standardParams.From}
- ${self:custom.standardParams.debugLevel}
methodResponses:
- statusCode: '200'
responseModels:
"application/json": EnvironmentDetails
responseHeaders:
- x-request-id: ${self:custom.standardOutputHeaders.x-request-id}
- warning: ${self:custom.standardOutputHeaders.warning}
updateEnivronment:
summary: Update a environment
description: "Method to update a given environment"
pathParams:
- name: "id"
description: "The ID of the environment that you want to retrieve"
schema:
type: "string"
required: true
requestBody:
description: "New version of the Environment Object"
requestHeaders:
- ${self:custom.standardParams.X-Request-Id}
- ${self:custom.standardParams.From}
- ${self:custom.standardParams.debugLevel}