Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
swagger-converter
Advanced tools
Swagger Converter converts Swagger documents from version 1.2 to version 2.0
Use npm
npm install swagger-converter --save
Swagger Converter expects two arguments.
resourceListing
is Swagger 1.2 entry point file.apiDeclarations
is an array of objects that are listed in resourceListing
var convert = require('swagger-converter');
var fs = require('fs');
var resourceListing = JSON.parse(fs.readFileSync('/path/to/petstore/index.json').toString());
var apiDeclarations = [
JSON.parse(fs.readFileSync('/path/to/petstore/pet.json').toString()),
JSON.parse(fs.readFileSync('/path/to/petstore/user.json').toString()),
JSON.parse(fs.readFileSync('/path/to/petstore/store.json').toString())
];
var swagger2Document = convert(resourceListing, apiDeclarations);
console.log(JSON.stringify(swagger2Document, null, 2));
Install via Bower
bower install --save swagger-converter
Include the browser.js
script in your HTML
<script src="/path/to/swagger-converter/browser.js"></script>
Use the script
var convert = SwaggerConverter.convert;
Install dependencies with npm install
command and use npm test
to run the test. Tests will fail if you break coding style.
Just run this command to make a new browser.js
npm run build
MIT. See LICENSE
FAQs
Converts Swagger documents from version 1.x to version 2.0
We found that swagger-converter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.