打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
JSON Generator – tool for generating random JSON data

http://www.json-generator.com/

Help

{{index}} Integer
Returns the index of current cloned object starting from 1.
{{numeric(a, b, format)}} Integer or Float
Can be negative. Generates random number in range from "a" to "b". If "a" is float, generated number will be float too. Generated number can be formatted according to "format" string. For more information visit Numeral.js.
{{bool}} Boolean
Generates random true/false
{{firstName(gender)}}, {{surname}} String
Generates random name, surname. Param "geneder" — string containing male or female.
{{gender}} String
Generates gender based on {{firstName}} that are called before of it or random value.
{{company}} String
Generates random company name.
{{phone(mask)}} String
Generates random phone number. Generated phone can be formatted according to "mask" string which contains "x" letters which will be replaced with digits.
{{email(random)}} String
Generates email based on {{firstName}}, {{surname}} and {{company}} that are called before of it. If param "random" is true — generates random email address.
{{countriesList}} Array
Returns a list of 205 unique countries.
{{country}} String
Generates random country.
{{state}} String
Generates random US state.
{{city}} String
Generates random US city.
{{street}} String
Generates random US street.
{{date(format)}} String

Generates random date that can be formatted according to "format" string. Format string may consist of any characters, but some of them considered tokens, and will be replaced by appropriate value from date.

Possible tokens include:

  • YYYY: 4-digit year
  • YY: last 2 digit of year
  • MM: ISO8601-compatible number of month (i.e. zero-padded) in year (with January being 1st month)
  • M: number of month in year without zero-padding (with January being 1st month)
  • dd: zero-padded number of day in month
  • d: number of day in month
  • hh: zero-padded hour
  • h: hour
  • mm: zero-padded minutes
  • m: minutes
  • ss: zero-padded seconds
  • s: seconds
  • TZ: time-zone in ISO8601-compatible format (i.e. "-04:00")

Longer tokens take precedence over shorter ones (so "MM" will aways be "04", not "44" in april).

{{guid}} String
Generates random globally unique identifier.
{{lorem(count, units)}} String
Generates Lorem Ipsum according to "count". Units can be "words", "sentences" or "paragraphs".
function(idx) { ... } Any valid
You can create your own function, that returns any value. Passed params: "idx" (index of current cloned object). "this" keyword contains generation methods which has same names as the tags.

About

We've all faced the problem of lack of information in our app. All interfaces seem lifeless and empty. Debugging with no data is also not simple.

I think that each of us has at least once in their lives created a bunch of files with JSON data, but they were just one object propagated without unique fields. JSON Generator was created in order to help with this. It provides an opportunity generate any data and in any quantity. Edit template, click "Generate" and you're done.

Usage

JSON Generator has a convenient syntax. You can specify JavaScript object for template that you see in the left box. It will be cloned in infinite depth. Fields may have any name and value, but it must be valid JavaScript. Values, which are strings, may contain one or more template tags. When you click "Generate" the data source object to be copied several times and the place of tags will be inserted random values.

You can copy the generated JSON to clipboard by clicking "Copy to clipboard". If you click "Upload", JSON will be stored on the server and you can download generated file by clicking "Download" button or access it via ajax-request by URL that will be copied to clipboard after clicking "Copy URL" button. Yes, JSON Generator can JSONP :) Generated files are stored 30 days and their size does not exceed 500 kB. Size appears at the top right of the field with the generated data. If file size text is red - file is too large for saving on server, but you can copy it to your clipboard and save locally to *.json file.

You can choose indentation for the generated JSON from the drop-down list. Also when you copy the link to uploaded code there is an "indent" param in URL. It can has values of 2, 3 and 4. If param is not specified code will be compact.

JSON Generator remembers your last template in localStorage. If you want to reset it, click "Reset" button to reset template and UI.

If you have found a bug, you have a suggestion for improving the application or just want to thank me, click on "Feedback".

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
Elasticsearch 8.X 如何生成 TB 级的测试数据 ?
Java常用方法封装
FastJSON、Gson和Jackson性能对比
十五天精通WCF——第十三天 用WCF来玩Rest
09. SDR 发布订阅
PHP 微信公众号开发
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服