
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
swagger-converter
Advanced tools
Converts Swagger documents from version
1.x
to version2.0
Use npm
npm install swagger-converter --save
It's recommended to use command line tools like swagger-tools
or swagger-spec-converter
for converting your spec. This module will not handle validation and if your spec is not valid can produce invalid spec.
Swagger Converter expects two arguments.
resourceListing
is Swagger 1.x entry point file.apiDeclarations
is a map with paths from resourceListing
as keys and resources as valuesvar swaggerConverter = require('swagger-converter');
var resourceListing = require('/path/to/petstore/index.json');
var apiDeclarations = {
'/pet': require('/path/to/petstore/pet.json'),
'/user': require('/path/to/petstore/user.json'),
'/store': require('/path/to/petstore/store.json')
};
var swagger2Document = swaggerConverter.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 swagger2Document = SwaggerConverter.convert(resourceListing, apiDeclarations);
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
The npm package swagger-converter receives a total of 83,405 weekly downloads. As such, swagger-converter popularity was classified as popular.
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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.