'Incorrect schema for yaml file using Serverless Framework Configuration - expected a string

I am using serverless framework configuration and aws for the serverless.yml file and also the yaml plugin on VSCode and it says that is incorrect type and is expecting a string.

events:
      - cloudwatchEvent:
          name: ${self:custom.transcribeJobName.${self:provider.stage}}
          event:
            source:
              - 'aws.transcribe'
            detail-type:
              - 'Transcribe Job State Change'
            detail:
              TranscriptionJobStatus:
                - COMPLETED
                - FAILED


Solution 1:[1]

The documentation of Serverless Framework no AWS events doesn't list AWS Transcribe at all. I also tried googling but couldn't find any native event for that.

https://www.serverless.com/framework/docs/providers/aws/events

So can you share which documentation or blog you're following to implement your solution?

Solution 2:[2]

Got this in my feed, the error is coming from serverless json-schema which isn't always up to date since it isn't maintained by the same team. I've created the PRs for both serverless json schema and for serverless types as well to get this issue sorted out at the source. It's obviously not thorough and compelete, but the best I cloud do.

https://github.com/lalcebo/json-schema/pull/13 https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59966

Edit:- schema updated, vscode should stop complaining on restart.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Hussain Mansoor
Solution 2