forked from APIs-guru/openapi-directory
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e19bbad
commit 4ece32f
Showing
4 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,8 @@ dev/ | |
|
||
# Temp output files | ||
tmp.yaml | ||
*.txt | ||
go*sh | ||
|
||
APIs/raw.githubusercontent.com/ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// script to find APIs which are not natively swagger_2 or openapi_3 | ||
// use with a find command piped to xargs for now | ||
|
||
const yaml = require('js-yaml'); | ||
const fs = require('fs'); | ||
const util = require('util'); | ||
|
||
for (let i=2;i<process.argv.length;i++) { | ||
let fname = process.argv[i]; | ||
let api = yaml.safeLoad(fs.readFileSync(fname,'utf8'),{json:true}); | ||
let origin = api.info["x-origin"]; | ||
if (origin && origin.length) { | ||
origin = origin.pop(); | ||
if (origin.converter && origin.format !== 'openapi') console.log(fname); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters