Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adding support for OpenAPI 3.1 #378

Merged
merged 11 commits into from
Dec 2, 2021
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ jobs:

- name: Run tests
run: npm test
env:
# `chalk` has troubles with color detection while on CI and also in how it's used within our tests.
# https://github.com/chalk/supports-color/issues/106
FORCE_COLOR: 1
27 changes: 27 additions & 0 deletions __tests__/__fixtures__/invalid-oas-3.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Invalid API",
"description": "This definition should not validate because the `mutualTLS` security type is only available on OpenAPI 3.1"
},
"paths": {
"/": {
"post": {
"responses": {
"200": {
"description": "OK"
}
},
"security": [{ "tlsAuth": [] }]
}
}
},
"components": {
"securitySchemes": {
"tlsAuth": {
"type": "mutualTLS"
}
}
}
}
1 change: 0 additions & 1 deletion __tests__/__fixtures__/swagger.json

This file was deleted.

14 changes: 14 additions & 0 deletions __tests__/cmds/__snapshots__/openapi.test.js.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`rdme openapi error handling should throw an error if an invalid OpenAPI 3.1 definition is supplied 1`] = `
[SyntaxError: OpenAPI schema validation failed.

REQUIRED must have required property 'openIdConnectUrl'

  24 | "components": {
  25 | "securitySchemes": {
> 26 | "tlsAuth": {
  | ^ ☹️ openIdConnectUrl is missing here!
  27 | "type": "mutualTLS"
  28 | }
  29 | }]
`;

exports[`rdme openapi should bundle and upload the expected content 1`] = `
Object {
"components": Object {
Expand Down
Loading