Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
generator-swaggerize
Advanced tools
Lead Maintainer: Trevor Livingston
Yeoman generator for swagger application with swaggerize
tools.
Generates projects for:
See also:
Install yeoman's yo
if you haven't already:
$ npm install -g yo
Install generator-swaggerize
:
$ npm install -g generator-swaggerize
Create a project:
$ yo swaggerize
yo swaggerize
Generates a new swaggerize application
$ yo swaggerize
Swaggerize Generator
Tell us a bit about your application
? Path (or URL) to swagger document: http://petstore.swagger.io/v2/swagger.json
? Framework: express
? What would you like to call this project: myapp
? Your name: Lorem Ipsum
? Your github user name: loremipsum
? Your email: loremipsum@awesome.com
create .eslintrc
create .gitignore
create .npmignore
create package.json
create README.md
.
.
.
If you want to generate (or regenerate) only a specific component, you can use swaggerize
sub generators.
yo swaggerize:data
Generates data
providers based on paths
and responses
in swagger api document.
yo swaggerize:handler
Generates handlers
based on paths
in swagger api document. (data
providers are also generated as a pre step)
yo swaggerize:test
Generates unit tests
based on paths
, parameters
and responses
in swagger api document. (handlers
and data
providers are also generated as a pre step)
/config
- A copy of the swagger api document file input, will be generated at /config/swagger.json
./data
- Data providers for paths(routes)./handlers
- Application paths (routes) based on swagger api./tests
- Unit tests for paths(routes).A handler file will be generated corresponding to every a path
definition of the swagger api (paths
).
More details or handlers and routing:
A data file will be generated corresponding to every a path
definition of the swagger api (paths
).
By default Response Mock generator is used to provide the data based on the responses
definition of swagger api.
Developers should replace these default mock data generators with actual data feeds, based on the functionality.
A unit test file will be generated corresponding to every a path
definition of the swagger api (paths
).
By default Request Mock generator is used to generator api requests based on the parameters
definition of swagger api.
--framework
- specify the framework (hapi
, express
, or restify
).--apiPath
- specify the path to the swagger document.--handlerPath
- specify the path to generate the handler files. By default handlers
directory.--dataPath
- specify the path to generate the data files. By default data
directory.--testPath
- specify the path to generate the unit test files. By default tests
directory.--skip-npm-install
- To skip the default npm install
on the generated project.apiPath
- Path (or URL) to swagger documentThe path to the swagger api document. This path could be a local or remote URL.
If there is no CLI option --apiPath
specified, the generator will prompt for apiPath
. The swagger api will be validated against the swagger schema and spec before proceeding with scaffolding process.
framework
- The choice of framework to generate the application.There are three options - express
, hapi
and restify
. If there is no CLI option --framework
specified, the generator will prompt for framework
.
Also, generator checks the working directory for package.json
dependencies, to find out whether the application already depends on, one of the framework options. If a match is found, that framework will be used as an option without prompting for the value.
appName
- The name of the applicationBy default the yeoman project root will be used as the name of the application, however, the prompt lets developers change this default.
creatorName
, githubUser
and email
- Creator details to build the package.json
.FAQs
Yeoman generator for openAPI(swagger) application
The npm package generator-swaggerize receives a total of 4 weekly downloads. As such, generator-swaggerize popularity was classified as not popular.
We found that generator-swaggerize demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.