Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
openapi-mock-server-codegen
Advanced tools
Readme
An OpenAPI mock server code generation tool.With this tool, you can directly generate a server supported by the koa (currently supported) framework through swagger.json/swagger.yaml
npm install -g openapi-mock-server-codegen
You can execute commands directly in the CMD environment
mock codegen -td D:\templates -cd D:\server
parameter name | info |
---|---|
-td, --templateDir | Template files dir. You can place multiple swagger files in this directory |
-cd, --codeDir | The server code generation directory |
--api | the path of OpenAPI definition file |
Execute the following command in the root directory of the generated code
node index.js
config.json file in the code root directory
item | info |
---|---|
port | Port number used by koa, default: 3020 |
randomResp | Whether to randomly generate the response defined in the response field, default: true |
useDict | Whether to use a dictionary to tell the faker framework what kind of data this field needs to generate, default: true |
locale | The localized language currently used by faker, default: "en_US" |
FAQs
openapi(v2 or v3) mock server codegen
The npm package openapi-mock-server-codegen receives a total of 22 weekly downloads. As such, openapi-mock-server-codegen popularity was classified as not popular.
We found that openapi-mock-server-codegen demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.