Skip to content

Commit

Permalink
updated requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Steiner committed Apr 13, 2021
1 parent 71256a2 commit e6b600c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
24 changes: 21 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ class MergeIntegrationPlugin {
'integration:merge:process': this.processCommand.bind(this),
'before:package:initialize': this.processPackage.bind(this)
};

// relevant since sls v1.78.0
if (this.serverless.configSchemaHandler) {
const openApiIntegrationSchema = {
type: 'object',
properties: {
inputFile: { type: 'string' },
inputDirectory: { type: 'string' },
mapping: { type: 'array' },
outputFile: { type: 'string' },
outputDirectory: { type: 'string' },
},
required: ['inputFile', 'mapping'],
};
this.serverless.configSchemaHandler.defineTopLevelProperty(
'openApiIntegration',
openApiIntegrationSchema,
);
}
}

generateHelp(command="integration") {
Expand All @@ -46,9 +65,8 @@ class MergeIntegrationPlugin {
}

processCommand() {
const configuration = this.serverless.config.configuration.openApiIntegration;

if (!configuration) {
let configuration = this.serverless.configurationInput.openApiIntegration
if (Object.keys(configuration).length === 0) {
this.serverless.cli.log('Openapi Integration: missing configuration');
}

Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,21 @@
"openapi",
"swagger"
],
"version": "1.0.0",
"version": "1.1.0",
"description": "Serverless plugin for integrating aws gateway syntax into open api specification",
"main": "lib/index.js",
"scripts": {
"test": "mocha test/unit"
},
"dependencies": {
"js-yaml": "^4.0.0",
"merge-yaml": "^1.1.0"
"merge-yaml": "^1.1.0",
"serverless": "2.x"
},
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^2.2.5"
},
"peerDependencies": {
"serverless": "2.x"
},
"engines": {
"node": ">=10.0"
},
Expand Down

0 comments on commit e6b600c

Please sign in to comment.