Skip to content
Mock data based on swagger
Cirru Clojure CSS
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
cli/build
data
entry
projects
src/swagger_mon
.gitattributes
.gitignore
.npmignore
README.md
calcit.cirru
deps.edn
package.json
release.edn
shadow-cljs.edn
upload.cirru
yarn.lock

README.md

Swagger Mon

generate mock data from swagger schema

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

Usages

Clojars Project

[jimengio/swagger-mon "0.0.2-a3"]
(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

yarn global add @jimengio/swagger-mon

Then run command swagger-api.json:

# prepare a swagger-api.json first!

PORT=7801 swagger-mon # read...

Workflow

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

License

MIT

You can’t perform that action at this time.