0.0.4 • Published 4 years ago

@jimengio/swagger-mon v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Swagger Mon

generate mock data from swagger schema

Site http://fe.jimu.io/swagger-mon/

Usages

Clojars Project

[jimengio/swagger-mon "0.0.3"]
(swagger-mon.core/gen-data schema-obj) ; returns json object

For swagger definition:

{"$schema":"http://json-schema.org/draft-04/schema#","type":"object","properties":{"id":{"type":"string"},"categoryId":{"type":"string"},"name":{"type":"string"},"varname":{"type":"string"},"type":{"type":"string"},"unit":{"type":"string"},"readonly":{"type":"boolean"},"reportType":{"type":"string"},"intervalMsec":{"type":"number"},"description":{"type":"string"},"createdAt":{"type":"string"},"updatedAt":{"type":"string"}}}

Generate data with random values:

{
  "readonly": false,
  "updatedAt": "2020-03-04T04:25:36.505Z",
  "reportType": "深圳",
  "createdAt": "2020-03-04T04:25:36.505Z",
  "id": "PN8R1ToO",
  "name": "菏泽",
  "type": "Quanzhou 黄山 嘉兴",
  "varname": "Yinchuan",
  "unit": "Hainan 舟山 保山",
  "intervalMsec": 69,
  "description": "Yichun 张家界 石家庄 Neijiang",
  "categoryId": "ks6MVtWng"
}

Mock strings are based on https://github.com/brightgems/china_city_dataset .

CLI

swagger-mon on npm

yarn global add @jimengio/swagger-mon

Then run command swagger-api.json:

# prepare a ./swagger-api.json first!

swagger-mon # read...

# default HTTP port
PORT=7801 swagger-mon

Workflow

Workflow https://github.com/mvc-works/calcit-workflow

License

MIT

0.0.4

4 years ago

0.0.4-a3

4 years ago

0.0.4-a2

4 years ago

0.0.3

4 years ago

0.0.3-a1

4 years ago

0.0.2

4 years ago

0.0.2-a2

4 years ago

0.0.2-a3

4 years ago

0.0.2-a4

4 years ago

0.0.2-a1

4 years ago

0.0.1-a2

4 years ago

0.0.1-a1

4 years ago