All Projects → yayoc → swagger-to-mock

yayoc / swagger-to-mock

Licence: other
Mock data generator CLI for Swagger3 (OpenAPI 3)

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to swagger-to-mock

Mockoon
Mockoon is the easiest and quickest way to run mock APIs locally. No remote deployment, no account required, open source.
Stars: ✭ 3,448 (+6936.73%)
Mutual labels:  mock, openapi3
Openapi Mock
OpenAPI mock server with random data generation
Stars: ✭ 202 (+312.24%)
Mutual labels:  mock, openapi3
HibiAPI
一个实现了多种常用站点的易用化API的程序 / A program that implements easy-to-use APIs for a variety of commonly used sites.
Stars: ✭ 427 (+771.43%)
Mutual labels:  openapi3
aiohttp-swagger3
Library for swagger documentation browsing and validating aiohttp requests using swagger specification 3.0
Stars: ✭ 54 (+10.2%)
Mutual labels:  openapi3
electron-mock-ipc
Mock Electron's ipcMain, and ipcRenderer
Stars: ✭ 21 (-57.14%)
Mutual labels:  mock
vue-admin-better
🚀🚀🚀vue admin,vue3 admin,vue3.0 admin,vue后台管理,vue-admin,vue3.0-admin,admin,vue-admin,vue-element-admin,ant-design,vue-admin-beautiful-pro,vab admin pro,vab admin plus,vue admin plus,vue admin pro
Stars: ✭ 12,962 (+26353.06%)
Mutual labels:  mock
clj-http-fake
Helper for faking clj-http requests.
Stars: ✭ 124 (+153.06%)
Mutual labels:  mock
electron-admin-element-vue
Electron Vue3.x Element-UI Admin
Stars: ✭ 37 (-24.49%)
Mutual labels:  mock
jmeter-k8s-starterkit
Ultimate starterkit for JMeter in Kubernetes. WIth live test reporting, JMeter monitoring, kubernetes monitoring and mock as a service
Stars: ✭ 40 (-18.37%)
Mutual labels:  mock
OpenAlchemy
Define SQLAlchemy models using the OpenAPI specification.
Stars: ✭ 39 (-20.41%)
Mutual labels:  openapi3
jest-dynalite
Jest preset to run Dynalite (DynamoDB local) per test runner
Stars: ✭ 125 (+155.1%)
Mutual labels:  mock
laika
Log, test, intercept and modify Apollo Client's operations
Stars: ✭ 99 (+102.04%)
Mutual labels:  mock
FireMock
Mock and stub HTTP requests. Test your apps with fake data and files responses.
Stars: ✭ 25 (-48.98%)
Mutual labels:  mock
wiresham
Simple TCP service mocking tool for replaying https://www.wireshark.org and http://www.tcpdump.org captured service traffic
Stars: ✭ 44 (-10.2%)
Mutual labels:  mock
vue-admin-work
🎉🎉🚀🚀🚀🚀vue-admin-work是一个中后台系统管理方案。使用 vue2.x 及周边全家桶工具开发而来。支持多种功能,不同角色权限🚀🚀🚀🎉🎉
Stars: ✭ 74 (+51.02%)
Mutual labels:  mock
definject
Unobtrusive Dependency Injector for Elixir
Stars: ✭ 46 (-6.12%)
Mutual labels:  mock
nei-toolkit
NEI 接口文档管理平台配套自动化工具
Stars: ✭ 814 (+1561.22%)
Mutual labels:  mock
go-types
Library providing opanapi3 and Go types for store/validation and transfer of ISO-4217, ISO-3166, and other types.
Stars: ✭ 14 (-71.43%)
Mutual labels:  openapi3
n26-api
Unofficial N26 Bank API documentation
Stars: ✭ 41 (-16.33%)
Mutual labels:  openapi3
Rubicon
Swift parser + mock generator
Stars: ✭ 42 (-14.29%)
Mutual labels:  mock

swagger-to-mock travis-ci Greenkeeper badge

Mock data generator CLI for Swagger3 (OpenAPI 3)

Install

npm i -g swagger-to-mock

Generate mock data

swagger-to-mock <YOUR SWAGGER FILE>

will generate JSON file per each API response.
JSON data values should be example values on your swagger if you specified examples.
Otherwise, swagger-to-mock follows data type rules and generate arbitrary values.
If there is no rule like format, values should be below.

string: ""
number: 0
integer: 0
boolean: true
array: []
object: {}

Example

If we pass an example YAML file

responses:
  '200':
    description: pet response
    content:
      application/json:
        schema:
          type: array
          items:
            $ref: '#/components/schemas/Pet'

swagger-to-mock will generate file named pets_get_200.json and the body should be below

[
  {
    "name": "",
    "tag": "",
    "id": 0
  }
]

File Name

Naming JSON file will follow the format below. ${API_PATH}_${HTTP_METHOD}_${RESPONSE_STATUS}.json

Data Type Support [In Progress]

swagger-to-mock will follow rules based on OpenAPI 3 specification for each data type, If the example value is not specified.

Mixed Types

If you specify oneOf or anyOf, The value should be at the top type.

Numbers

  • format
  • Minimum and Maximum
  • Multiples

String

  • format
  • pattern

Boolean

value should be true or false.

Null

Arrays

  • Mixed-Type Arrays
  • Array Length

Objects

  • Free-Form Object

Files

Any Type

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].