Skip to content

Commit

Permalink
test: add test openapi v3
Browse files Browse the repository at this point in the history
  • Loading branch information
aymen94 authored and ioggstream committed Jul 25, 2019
1 parent 31e9277 commit fa01974
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/__tests__/gen-api-models-oa3.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import * as SwaggerParser from "swagger-parser";

test("Validate Schema OpenApi 3.0 ", () => {
let flag = false;
SwaggerParser.validate(`${__dirname}/api_oa3.yaml`, (err, api) => {
if (err) {
console.error(err);
} else {
flag = true;
console.log(
"API name: %s, Version: %s",
api.info.title,
api.info.version
);
}
});
expect(flag).toBe(true);
});
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3165,6 +3165,14 @@ openapi-types@^1.3.5:
resolved "https://registry.yarnpkg.com/openapi-types/-/openapi-types-1.3.5.tgz#6718cfbc857fe6c6f1471f65b32bdebb9c10ce40"
integrity sha512-11oi4zYorsgvg5yBarZplAqbpev5HkuVNPlZaPTknPDzAynq+lnJdXAmruGWP0s+dNYZS7bjM+xrTpJw7184Fg==

openapi-schema-validation@^0.4.2:
version "0.4.2"
resolved "https://registry.yarnpkg.com/openapi-schema-validation/-/openapi-schema-validation-0.4.2.tgz#895c29021be02e000f71c51f859da52118eb1e21"
dependencies:
jsonschema "1.2.4"
jsonschema-draft4 "^1.0.0"
swagger-schema-official "2.0.0-bab6bed"

optimist@^0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686"
Expand Down Expand Up @@ -4314,6 +4322,10 @@ validate-npm-package-license@^3.0.1:
spdx-correct "^3.0.0"
spdx-expression-parse "^3.0.0"

validator@^10.0.0:
version "10.11.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-10.11.0.tgz#003108ea6e9a9874d31ccc9e5006856ccd76b228"

validator@^10.1.0:
version "10.3.0"
resolved "https://registry.yarnpkg.com/validator/-/validator-10.3.0.tgz#157a8c0981858cff381f59aabcdb8f83b57317cc"
Expand Down

0 comments on commit fa01974

Please sign in to comment.