Skip to content

Commit

Permalink
resubmit fixes for #26. version 0.13.2
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidBiesack committed Apr 23, 2024
1 parent 58358a8 commit 19348b1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apiture/openapi-down-convert",
"version": "0.13.0",
"version": "0.13.2",
"description": "Tool to down convert OpenAPI 3.1 to OpenAPI 3.0",
"main": "lib/src/index.js",
"bin": {
Expand Down
5 changes: 3 additions & 2 deletions src/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ export class Converter {
private json(x) {
return JSON.stringify(x, null, 2);
}
static readonly METHODS = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put', 'trace' ];
/** HTTP methods */
static readonly HTTP_METHODS = ['delete', 'get', 'head', 'options', 'patch', 'post', 'put', 'trace' ];
/**
* OpenAPI 3.1 defines a new `openIdConnect` security scheme.
* Down-convert the scheme to `oauth2` / authorization code flow.
Expand All @@ -384,7 +385,7 @@ export class Converter {
const paths = this.openapi30?.paths;
for (const path in paths) {
// filter out path.{$ref, summary, description, parameters, servers} and x-* specification extensions
const methods = Object.keys(paths[path]).filter((op) => Converter.METHODS.includes(op));
const methods = Object.keys(paths[path]).filter((op) => Converter.HTTP_METHODS.includes(op));
methods.forEach(method => {
const operation = paths[path][method];
const sec = (operation?.security || []) as object[];
Expand Down

0 comments on commit 19348b1

Please sign in to comment.