Skip to content

Commit

Permalink
Lint OpenAPI spec (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorads authored Feb 14, 2022
1 parent ca5225b commit 36e1e10
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .redocly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiDefinitions:
petstore: ./src/handlers/swagger/openapi.json

lint:
extends:
- recommended
rules:
# Servers added at Swagger UI runtime
no-empty-servers:
severity: off
# Ignore warnings
operation-operationId:
severity: off
info-license:
severity: off
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "npm-run-all -p -c lint:*",
"lint:tsc": "tsc --noEmit",
"lint:eslint": "eslint \"**/*.{js,ts}\"",
"lint:openapi": "openapi lint",
"db:install": "serverless plugin install --name serverless-dynamodb-local && serverless dynamodb install",
"db:start": "serverless dynamodb start",
"dev": "serverless offline",
Expand All @@ -22,6 +23,7 @@
"deploy": "serverless deploy"
},
"devDependencies": {
"@redocly/openapi-cli": "^1.0.0-beta.81",
"@types/aws-lambda": "^8.10.76",
"@types/jest": "26.0.23",
"@types/node": "^15.6.1",
Expand Down
161 changes: 157 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,50 @@
resolved "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz"
integrity sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=

"@redocly/ajv@^8.6.4":
version "8.6.4"
resolved "https://registry.yarnpkg.com/@redocly/ajv/-/ajv-8.6.4.tgz#94053e7a9d4146d1a4feacd3813892873f229a85"
integrity sha512-y9qNj0//tZtWB2jfXNK3BX18BSBp9zNR7KE7lMysVHwbZtY392OJCjm6Rb/h4UHH2r1AqjNEHFD6bRn+DqU9Mw==
dependencies:
fast-deep-equal "^3.1.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"
uri-js "^4.2.2"

"@redocly/openapi-cli@^1.0.0-beta.81":
version "1.0.0-beta.81"
resolved "https://registry.yarnpkg.com/@redocly/openapi-cli/-/openapi-cli-1.0.0-beta.81.tgz#1beb174d013f757403f6556c614ea5a56308d122"
integrity sha512-lynvvf8EiJ+C24ghzzDZ0iNmbhaLrCFI/2TVa0RuA6b3kI4kgVPul2Ivx1Txo/TJv2eIyqTTzS6lHYriyYeXzQ==
dependencies:
"@redocly/openapi-core" "1.0.0-beta.81"
"@types/node" "^14.11.8"
assert-node-version "^1.0.3"
chokidar "^3.5.1"
colorette "^1.2.0"
glob "^7.1.6"
glob-promise "^3.4.0"
handlebars "^4.7.6"
https-proxy-agent "^5.0.0"
portfinder "^1.0.26"
simple-websocket "^9.0.0"
yargs "17.0.1"

"@redocly/openapi-core@1.0.0-beta.81":
version "1.0.0-beta.81"
resolved "https://registry.yarnpkg.com/@redocly/openapi-core/-/openapi-core-1.0.0-beta.81.tgz#c3684b8c4fcf4d4d25d23b46964809a3f0097dcb"
integrity sha512-cLmGZD+7U3NB2u5q6E8gPKENEKlQmvD1D4m+eIixgM5yQ2K3w3VaD84eNPhvRlvgu7yPrDX9mmTj1jVp254SRA==
dependencies:
"@redocly/ajv" "^8.6.4"
"@types/node" "^14.11.8"
colorette "^1.2.0"
js-levenshtein "^1.1.6"
js-yaml "^4.1.0"
lodash.isequal "^4.5.0"
minimatch "^3.0.4"
node-fetch "^2.6.1"
pluralize "^8.0.0"
yaml-ast-parser "0.0.43"

"@serverless/cli@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@serverless/cli/-/cli-1.6.0.tgz"
Expand Down Expand Up @@ -1706,6 +1750,14 @@
"@types/qs" "*"
"@types/serve-static" "*"

"@types/glob@*":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb"
integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==
dependencies:
"@types/minimatch" "*"
"@types/node" "*"

"@types/graceful-fs@^4.1.2":
version "4.1.5"
resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.5.tgz"
Expand Down Expand Up @@ -1796,6 +1848,11 @@
resolved "https://registry.npmjs.org/@types/mime/-/mime-2.0.2.tgz"
integrity sha512-4kPlzbljFcsttWEq6aBW0OZe6BDajAmyvr2xknBG92tejQnvdGtT9+kXSZ580DqpxY9qG2xeQVF9Dq0ymUTo5Q==

"@types/minimatch@*":
version "3.0.5"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40"
integrity sha512-Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ==

"@types/node@*":
version "14.0.11"
resolved "https://registry.npmjs.org/@types/node/-/node-14.0.11.tgz"
Expand All @@ -1811,6 +1868,11 @@
resolved "https://registry.npmjs.org/@types/node/-/node-13.13.33.tgz"
integrity sha512-1B3GM1yuYsFyEvBb+ljBqWBOylsWDYioZ5wpu8AhXdIhq20neXS7eaSC8GkwHE0yQYGiOIV43lMsgRYTgKZefQ==

"@types/node@^14.11.8":
version "14.18.11"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.11.tgz#9bd810a959e1728d78df0f68b5c825b8ea7156f4"
integrity sha512-zCoCEMA+IPpsRkyCFBqew5vGb7r8RSiB3uwdu/map7uwLAfu1MTazW26/pUDWoNnF88vJz4W3U56i5gtXNqxGg==

"@types/p-queue@^2.3.2":
version "2.3.2"
resolved "https://registry.npmjs.org/@types/p-queue/-/p-queue-2.3.2.tgz"
Expand Down Expand Up @@ -2484,6 +2546,14 @@ asn1@~0.2.3:
dependencies:
safer-buffer "~2.1.0"

assert-node-version@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/assert-node-version/-/assert-node-version-1.0.3.tgz#caea5d1b6a58dbce59661208df1e1b9e4c580f91"
integrity sha1-yupdG2pY285ZZhII3x4bnkxYD5E=
dependencies:
expected-node-version "^1.0.0"
semver "^5.0.3"

assert-plus@1.0.0, assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz"
Expand Down Expand Up @@ -3324,6 +3394,11 @@ color@3.0.x:
color-convert "^1.9.1"
color-string "^1.5.2"

colorette@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.4.0.tgz#5190fbb87276259a86ad700bff2c6d6faa3fca40"
integrity sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==

colorette@^1.2.1, colorette@^1.2.2:
version "1.2.2"
resolved "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz"
Expand Down Expand Up @@ -4616,6 +4691,11 @@ expect@^27.0.2:
jest-message-util "^27.0.2"
jest-regex-util "^27.0.1"

expected-node-version@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/expected-node-version/-/expected-node-version-1.0.2.tgz#b8d225b9bf676a9e87e06dbd615b52fc9d1e386b"
integrity sha1-uNIlub9nap6H4G29YVtS/J0eOGs=

express@^4.16.4:
version "4.17.1"
resolved "https://registry.npmjs.org/express/-/express-4.17.1.tgz"
Expand Down Expand Up @@ -5246,6 +5326,13 @@ glob-parent@^5.1.0, glob-parent@^5.1.2, glob-parent@~5.1.0, glob-parent@~5.1.2:
dependencies:
is-glob "^4.0.1"

glob-promise@^3.4.0:
version "3.4.0"
resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-3.4.0.tgz#b6b8f084504216f702dc2ce8c9bc9ac8866fdb20"
integrity sha512-q08RJ6O+eJn+dVanerAndJwIcumgbDdYiUT7zFQl3Wm1xD6fBKtah7H8ZJChj4wP+8C+QfeVy8xautR7rdmKEw==
dependencies:
"@types/glob" "*"

glob-to-regexp@^0.4.1:
version "0.4.1"
resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz"
Expand Down Expand Up @@ -5413,6 +5500,18 @@ growl@1.10.5:
resolved "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz"
integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==

handlebars@^4.7.6:
version "4.7.7"
resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.7.tgz#9ce33416aad02dbd6c8fafa8240d5d98004945a1"
integrity sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==
dependencies:
minimist "^1.2.5"
neo-async "^2.6.0"
source-map "^0.6.1"
wordwrap "^1.0.0"
optionalDependencies:
uglify-js "^3.1.4"

har-schema@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz"
Expand Down Expand Up @@ -6643,6 +6742,11 @@ joycon@^3.0.1:
resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.0.1.tgz"
integrity sha512-SJcJNBg32dGgxhPtM0wQqxqV0ax9k/9TaUskGDSJkSFSQOEWWvQ3zzWdGQRIUry2j1zA5+ReH13t0Mf3StuVZA==

js-levenshtein@^1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/js-levenshtein/-/js-levenshtein-1.1.6.tgz#c6cee58eb3550372df8deb85fad5ce66ce01d59d"
integrity sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==

js-string-escape@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz"
Expand Down Expand Up @@ -7084,6 +7188,11 @@ lodash.isempty@^4.4.0:
resolved "https://registry.npmjs.org/lodash.isempty/-/lodash.isempty-4.4.0.tgz"
integrity sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=

lodash.isequal@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=

lodash.isinteger@^4.0.4:
version "4.0.4"
resolved "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz"
Expand Down Expand Up @@ -7591,7 +7700,7 @@ negotiator@0.6.2:
resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz"
integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==

neo-async@^2.6.2:
neo-async@^2.6.0, neo-async@^2.6.2:
version "2.6.2"
resolved "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz"
integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==
Expand Down Expand Up @@ -7643,7 +7752,7 @@ node-fetch@^2.6.0:
resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==

node-fetch@^2.6.7:
node-fetch@^2.6.1, node-fetch@^2.6.7:
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
Expand Down Expand Up @@ -8267,7 +8376,12 @@ please-upgrade-node@^3.2.0:
dependencies:
semver-compare "^1.0.0"

portfinder@^1.0.28:
pluralize@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-8.0.0.tgz#1a6fa16a38d12a1901e0320fa017051c539ce3b1"
integrity sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA==

portfinder@^1.0.26, portfinder@^1.0.28:
version "1.0.28"
resolved "https://registry.npmjs.org/portfinder/-/portfinder-1.0.28.tgz"
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
Expand Down Expand Up @@ -8971,7 +9085,7 @@ semver-diff@^3.1.1:
dependencies:
semver "^6.3.0"

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0:
"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0, semver@^5.7.0:
version "5.7.1"
resolved "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
Expand Down Expand Up @@ -9299,6 +9413,17 @@ simple-swizzle@^0.2.2:
dependencies:
is-arrayish "^0.3.1"

simple-websocket@^9.0.0:
version "9.1.0"
resolved "https://registry.yarnpkg.com/simple-websocket/-/simple-websocket-9.1.0.tgz#91cbb39eafefbe7e66979da6c639109352786a7f"
integrity sha512-8MJPnjRN6A8UCp1I+H/dSFyjwJhp6wta4hsVRhjf8w9qBHRzxYt14RaOcjvQnhD1N4yKOddEjflwMnQM4VtXjQ==
dependencies:
debug "^4.3.1"
queue-microtask "^1.2.2"
randombytes "^2.1.0"
readable-stream "^3.6.0"
ws "^7.4.2"

sisteransi@^1.0.4:
version "1.0.5"
resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz"
Expand Down Expand Up @@ -10216,6 +10341,11 @@ typescript@^4.3.4:
resolved "https://registry.npmjs.org/typescript/-/typescript-4.3.4.tgz"
integrity sha512-uauPG7XZn9F/mo+7MrsRjyvbxFpzemRjKEZXS4AK83oP2KKOJPvb+9cO/gmnv8arWZvhnjVOXz7B49m1l0e9Ew==

uglify-js@^3.1.4:
version "3.15.1"
resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.15.1.tgz#9403dc6fa5695a6172a91bc983ea39f0f7c9086d"
integrity sha512-FAGKF12fWdkpvNJZENacOH0e/83eG6JyVQyanIJaBXCN1J11TUQv1T1/z8S+Z0CG0ZPk1nPcreF/c7lrTd0TEQ==

unbox-primitive@^1.0.0, unbox-primitive@^1.0.1:
version "1.0.1"
resolved "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.1.tgz"
Expand Down Expand Up @@ -10638,6 +10768,11 @@ word-wrap@^1.2.3, word-wrap@~1.2.3:
resolved "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz"
integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==

wordwrap@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb"
integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=

wrap-ansi@^5.1.0:
version "5.1.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz"
Expand Down Expand Up @@ -10685,6 +10820,11 @@ ws@^7.3.1, ws@^7.4.4, ws@~7.4.2:
resolved "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz"
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==

ws@^7.4.2:
version "7.5.7"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.7.tgz#9e0ac77ee50af70d58326ecff7e85eb3fa375e67"
integrity sha512-KMvVuFzpKBuiIXW3E4u3mySRO2/mCHSyZDJQM5NQ9Q9KHWHWh0NHgfbRMLLrceUK5qAL4ytALJbpRMjixFZh8A==

ws@^7.4.5:
version "7.5.0"
resolved "https://registry.npmjs.org/ws/-/ws-7.5.0.tgz"
Expand Down Expand Up @@ -10804,6 +10944,19 @@ yargs@13.3.2, yargs@^13.3.0:
y18n "^4.0.0"
yargs-parser "^13.1.2"

yargs@17.0.1:
version "17.0.1"
resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.0.1.tgz#6a1ced4ed5ee0b388010ba9fd67af83b9362e0bb"
integrity sha512-xBBulfCc8Y6gLFcrPvtqKz9hz8SO0l1Ni8GgDekvBX2ro0HRQImDGnikfc33cgzcYUSncapnNcZDjVFIH3f6KQ==
dependencies:
cliui "^7.0.2"
escalade "^3.1.1"
get-caller-file "^2.0.5"
require-directory "^2.1.1"
string-width "^4.2.0"
y18n "^5.0.5"
yargs-parser "^20.2.2"

yargs@^16.0.3, yargs@^16.2.0:
version "16.2.0"
resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz"
Expand Down

0 comments on commit 36e1e10

Please sign in to comment.