JSON to Crystal
Convert JSON structures to Crystal classes. A hosted version is available at https://watzon.me/projects/json-to-crystal.
Usage
const JsonToCrystal = const json2crystal = console
class AutoGenerated
JSON.mapping({
string: { type: String },
boolean: { type: Bool },
integer: { type: Int32 },
float: { type: Float64 },
another_class: { type: AnotherClass }
})
class AnotherClass
JSON.mapping({
arr: { type: Array(Int32) },
hello: { type: String }
})
end
end