/JSONFormatter

jason to model code

Primary LanguageSwift

JSONFormatter

a simple jason to model code MacOS tool

json sample

{
"FixedTelephone" : null,
"IsSelect" : false,
"UserId" : 5651,
"Price" : 2.3,
"UnitName" :"haha",
"status" : 0,
"isMale":1
}

converted to

var status:Bool?
var UserId:Int?
var UnitName:String?
var isMale:Bool?
var IsSelect:Bool?
var Price:Double?
var FixedTelephone:AnyObject?

notice

  • if value is null,it will be converted to AnyObject type
  • if value is 0 or 1,it default converted to Bool type