Skip to content

Commit

Permalink
fix: only add schema check for newer versions of sls
Browse files Browse the repository at this point in the history
  • Loading branch information
theburningmonk committed Aug 12, 2020
1 parent c658c29 commit c951bcf
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,20 +141,23 @@ class ServerlessStepFunctions {
.then(this.display),
};

const stepFunctionsSchema = {
type: 'object',
properties: {
stateMachines: { type: 'object' },
validate: { type: 'boolean' },
noOutput: { type: 'boolean' },
activities: { type: 'array' },
},
required: ['stateMachines'],
};
this.serverless.configSchemaHandler.defineTopLevelProperty(
'stepFunctions',
stepFunctionsSchema,
);
// relevant since sls v1.78.0
if (this.serverless.configSchemaHandler) {
const stepFunctionsSchema = {
type: 'object',
properties: {
stateMachines: { type: 'object' },
validate: { type: 'boolean' },
noOutput: { type: 'boolean' },
activities: { type: 'array' },
},
required: ['stateMachines'],
};
this.serverless.configSchemaHandler.defineTopLevelProperty(
'stepFunctions',
stepFunctionsSchema,
);
}
}

invoke() {
Expand Down

0 comments on commit c951bcf

Please sign in to comment.