Skip to content

Commit 14fe704

Browse files
authored
Merge pull request #666 from blgm/fix-644
Add OpenAPI and Swagger validation to Travis CI
2 parents 6c804d4 + 6ab5672 commit 14fe704

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
language: bash
55

66
services:
7+
- docker
78

89
before_install:
9-
10+
1011
script:
1112
tools/verify-all.sh

tools/verify-all.sh

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
# Copyright 2017 The authors
3+
# Copyright 2017 - 2019 The authors
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -14,19 +14,15 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
# This script will scan all md (markdown) files for bad references.
18-
# It will look for strings of the form [...](...) and make sure that
19-
# the (...) points to either a valid file in the source tree or, in the
20-
# case of it being an http url, it'll make sure we don't get a 404.
17+
# This script runs all the verification checks, both for CI and development
2118
#
22-
# Usage: verify-links.sh [ dir | file ... ]
23-
# default arg is root of our source tree
19+
# Usage: verify-all.sh
2420

2521
set -o errexit
2622
set -o nounset
2723
set -o pipefail
2824

29-
REPODIR=$(dirname "${BASH_SOURCE}")/..
25+
REPODIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"/..; pwd -P)"
3026

3127
rc=0
3228

@@ -45,4 +41,10 @@ echo Verify description json fields
4541
echo Verify spaces after periods
4642
"${REPODIR}/tools/verify-spaces.sh" -v "${REPODIR}"/spec.md "${REPODIR}"/profile.md "${REPODIR}"/compatibility.md || rc=1
4743

44+
echo Verify OpenAPI
45+
docker run --rm -v "${REPODIR}":/local openapitools/openapi-generator-cli validate -i /local/openapi.yaml || rc=1
46+
47+
echo Verify Swagger
48+
docker run --rm -v "${REPODIR}":/local openapitools/openapi-generator-cli validate -i /local/swagger.yaml || rc=1
49+
4850
exit $rc

0 commit comments

Comments
 (0)