Skip to content

Commit

Permalink
Merge branch 'swagger' into 'master'
Browse files Browse the repository at this point in the history
#2943: Add validator for swagger document

See merge request linagora/lgs/openpaas/esn!1159
  • Loading branch information
billyfrost418 committed Apr 23, 2020
2 parents a8bc655 + 4a60361 commit c57197f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ swagger:
stage: swagger
script:
- grunt swagger-generate
- grunt swagger-validate
artifacts:
paths:
- ./doc/REST_API/swagger/swagger.json
Expand Down
12 changes: 12 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,16 @@ module.exports = function(grunt) {
}
},

swagger_checker: {
options: {
path: './doc/REST_API/swagger/swagger.json',
validate: {
schema: true,
spec: false
}
}
},

swagger_generate: {
options: {
baseDir: __dirname,
Expand Down Expand Up @@ -274,6 +284,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-eslint');
grunt.loadNpmTasks('grunt-wait-server');
grunt.loadNpmTasks('@linagora/grunt-i18n-checker');
grunt.loadNpmTasks('grunt-swagger-checker');
grunt.loadNpmTasks('grunt-swagger-generate');
grunt.loadNpmTasks('grunt-puglint');

Expand Down Expand Up @@ -337,6 +348,7 @@ module.exports = function(grunt) {
grunt.registerTask('swagger-generate', 'Grunt plugin for swagger generate', ['swagger_generate']);
grunt.registerTask('pug-linter', 'Check the pug/jade files', ['puglint:all']);
grunt.registerTask('linters', 'Check code for lint', ['eslint:all', 'lint_pattern', 'i18n', 'pug-linter']);
grunt.registerTask('swagger-validate', ['swagger_checker']);

/**
* Usage:
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
"@linagora/grunt-i18n-checker": "2.0.5",
"@linagora/grunt-lint-pattern": "0.1.4",
"@linagora/grunt-run-grunt": "0.1.4",
"grunt-swagger-checker": "linagora/grunt-swagger-checker",
"@linagora/i18n-checker": "2.0.3",
"@linagora/karma-ng-jade2module-preprocessor": "0.5.3",
"chai": "3.5.0",
Expand Down

0 comments on commit c57197f

Please sign in to comment.