Unrecognized property 'documentation'

Hi All,
In my server.yml i am defining API documentation as per https://www.serverless.com/plugins/serverless-aws-documentation

I have documentation plugin installed and added like this

plugins:
  - serverless-aws-documentation

I have function defined like this

  create-company:
    handler: bin/create-company
    events:
      - http:
          path: v1/owner/{ownerId}/company
          method: POST
          documentation:
            summary: Create a new Company
            pathParams:
              -
                name: "ownerId"
                description: "Owner ID"
                required: true
                type: string
            requestHeaders:
              -
                name: "Authorization"
                description: "Bearer token"
                required: true
                type: string
            requestModels:
               "application/json": CreateCompanyRequest
            methodResponses:
              -
                statusCode: '200'
                responseModels:
                  "application/json": "CreateCompanyResponse"
                responseHeaders:
                  -
                    name: Content-Type
                    description: Content Type
                    type: string
    package:
      exclude:
        - ./**
      include:
        - ./bin/create-company

also under custom i have Models defined properly.

Until Few days back it was working fine and suddenly it stopped working, from git i checkout my few days old version of project and tried it, thats also failing with following error

Serverless: at ‘functions[‘create-company’].events[0].http’: unrecognized property ‘documentation’

Only thing which has changed is i recently updated serverless version to latest.

My Current env looks like this

sls version
Framework Core: 2.8.0
Plugin: 4.1.1
SDK: 2.3.2
Components: 3.2.3

Not sure how to solve this issue. I have tried going back to previous version for serverless(2.7.0) as well as documentation plugin(1.0.0, 1.0.1). i have checked for typo errors but its happening in my 3 serverless projects

2 Likes

I think i have found the issue(which need to be fixed with in server less) and workaround for now.,

Workaround

Rollback your serverless enviornment to version 2.5.0 (when writing this current version is 2.8.0)

> sls -v
Framework Core: 2.5.0
Plugin: 4.1.1
SDK: 2.3.2
Components: 3.2.5

Problem :

I went through the Serverless releases and one particular release/Commit caught my eyes 2.6.0

Aws http event schema #8301

Recently schema for http has been created which doesn’t include ‘documentation’ tag/key. Check the Exact commit lines.

I am not into JS development but i hope this can be priortised/fixed quickly by serverless devs or someone who knows this code base.

I created this Docker image with serverles and aws cli V2 and it work perfectly, from now onwards will keep using this image until its fixed by serverless and may be then go back to latest serverless version.

FROM node:14.14.0-buster-slim
RUN whoami
RUN npm install -g serverless@2.5.0; serverless -v
RUN apt-get update -y; apt-get install curl -y; apt-get install zip -y
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"; unzip awscliv2.zip; ./aws/install
RUN rm -fR awscliv2.zip
RUN npm install serverless-aws-documentation --save-dev
RUN npm install serverless-domain-manager --save-dev
RUN npm install serverless-plugin-split-stacks --save-dev
RUN apt-get install --reinstall make
RUN aws --version

huge thanks for keeping updating! really appreciating