/v1/mobile/json-swift1 credit / callJSON to Swift Codable
Generate Swift Codable structs from a JSON document.
| Parameter | Type | Required | Description |
|---|---|---|---|
| json | string | Yes | JSON text. |
| rootName | string | No | Name for the root struct. Default: Root. |
Request
curl -X POST https://toolsonduty.com/api/v1/mobile/json-swift \
-H "Authorization: ******" \
-H "Content-Type: application/json" \
-d '{"json":"{\"id\":1,\"name\":\"a\"}"}'Response
{
"ok": true,
"data": {
"result": "struct Root: Codable {\n let id: Int\n let name: String\n}"
}
}