Code Monkey home page Code Monkey logo

baby's People

Contributors

markiv avatar nixzhu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

baby's Issues

CB not creating the outer init correctly.

NASAJSON.txt

Firstly NIX for a great App, awesome isn't a word I use that often being a lot older than you but a very impressive piece of work, many thanks.

Attached is some very typical NASA JSON from their public interfaces. It's actually relatively simple and well behaved compared to what you can request :-)

I am taking this and then running it through CuteBaby to generate the structure off the JSON.

Towards the bottom of the output CB has two errors:-

    • Unsupported; array in array!
  1. init?(json: [String: Any]) {

I think 2. is meant to be the init for NewModel.

I am Decodable(ing) all the structs and everything else is fine although the array is being handled piecemeal.

Could I have your thoughts?

Many thanks,

Ed Hasted


not parsing right

Briefly describe your problem when use Baby.

        let comment: Comment????????????????????????
        let ref: Any?????????????
        let refType: String????????????
        let masterBranch: String????????????
        let description: String????????????
        let pusherType: String????????????

JSON String

[{"id":"6228926947","type":"WatchEvent","actor":{"id":4371178,"login":"msching","display_login":"msching","gravatar_id":"","url":"https://api.github.com/users/msching","avatar_url":"https://avatars.githubusercontent.com/u/4371178?"},"repo":{"id":95496672,"name":"weichsel/ZIPFoundation","url":"https://api.github.com/repos/weichsel/ZIPFoundation"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-11T01:28:22Z"},{"id":"6227592957","type":"WatchEvent","actor":{"id":51363,"login":"0xced","display_login":"0xced","gravatar_id":"","url":"https://api.github.com/users/0xced","avatar_url":"https://avatars.githubusercontent.com/u/51363?"},"repo":{"id":35160657,"name":"canton7/RestEase","url":"https://api.github.com/repos/canton7/RestEase"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T21:06:35Z"},{"id":"6224298602","type":"WatchEvent","actor":{"id":219689,"login":"lexrus","display_login":"lexrus","gravatar_id":"","url":"https://api.github.com/users/lexrus","avatar_url":"https://avatars.githubusercontent.com/u/219689?"},"repo":{"id":91767095,"name":"tidwall/pinhole","url":"https://api.github.com/repos/tidwall/pinhole"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T13:59:19Z"},{"id":"6224291375","type":"WatchEvent","actor":{"id":219689,"login":"lexrus","display_login":"lexrus","gravatar_id":"","url":"https://api.github.com/users/lexrus","avatar_url":"https://avatars.githubusercontent.com/u/219689?"},"repo":{"id":96056297,"name":"mmcloughlin/globe","url":"https://api.github.com/repos/mmcloughlin/globe"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T13:58:29Z"},{"id":"6223878618","type":"IssueCommentEvent","actor":{"id":15805487,"login":"commando24","display_login":"commando24","gravatar_id":"","url":"https://api.github.com/users/commando24","avatar_url":"https://avatars.githubusercontent.com/u/15805487?"},"repo":{"id":2514500,"name":"muhku/FreeStreamer","url":"https://api.github.com/repos/muhku/FreeStreamer"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/222","repository_url":"https://api.github.com/repos/muhku/FreeStreamer","labels_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/222/labels{/name}","comments_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/222/comments","events_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/222/events","html_url":"https://github.com/muhku/FreeStreamer/issues/222","id":117599839,"number":222,"title":"audioStream play/pause problem","user":{"login":"blackmatch","id":12443954,"avatar_url":"https://avatars0.githubusercontent.com/u/12443954?v=3","gravatar_id":"","url":"https://api.github.com/users/blackmatch","html_url":"https://github.com/blackmatch","followers_url":"https://api.github.com/users/blackmatch/followers","following_url":"https://api.github.com/users/blackmatch/following{/other_user}","gists_url":"https://api.github.com/users/blackmatch/gists{/gist_id}","starred_url":"https://api.github.com/users/blackmatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blackmatch/subscriptions","organizations_url":"https://api.github.com/users/blackmatch/orgs","repos_url":"https://api.github.com/users/blackmatch/repos","events_url":"https://api.github.com/users/blackmatch/events{/privacy}","received_events_url":"https://api.github.com/users/blackmatch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-11-18T14:37:39Z","updated_at":"2017-07-10T13:05:24Z","closed_at":"2016-02-07T06:54:55Z","body":"when I call the function [audioStream play], I need to call the function [audioStream pause] twice, then the music pause.Then need to call the function [audioStream play] twice, music play.\n"},"comment":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/comments/314099289","html_url":"https://github.com/muhku/FreeStreamer/issues/222#issuecomment-314099289","issue_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/222","id":314099289,"user":{"login":"commando24","id":15805487,"avatar_url":"https://avatars0.githubusercontent.com/u/15805487?v=3","gravatar_id":"","url":"https://api.github.com/users/commando24","html_url":"https://github.com/commando24","followers_url":"https://api.github.com/users/commando24/followers","following_url":"https://api.github.com/users/commando24/following{/other_user}","gists_url":"https://api.github.com/users/commando24/gists{/gist_id}","starred_url":"https://api.github.com/users/commando24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commando24/subscriptions","organizations_url":"https://api.github.com/users/commando24/orgs","repos_url":"https://api.github.com/users/commando24/repos","events_url":"https://api.github.com/users/commando24/events{/privacy}","received_events_url":"https://api.github.com/users/commando24/received_events","type":"User","site_admin":false},"created_at":"2017-07-10T13:05:24Z","updated_at":"2017-07-10T13:05:24Z","body":"I am still facing this issue in version 3.7.3. @muhku please look into this."}},"public":true,"created_at":"2017-07-10T13:05:24Z"},{"id":"6223367359","type":"WatchEvent","actor":{"id":51363,"login":"0xced","display_login":"0xced","gravatar_id":"","url":"https://api.github.com/users/0xced","avatar_url":"https://avatars.githubusercontent.com/u/51363?"},"repo":{"id":30097856,"name":"anagram4wander/VirtualizingObservableCollection","url":"https://api.github.com/repos/anagram4wander/VirtualizingObservableCollection"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T11:43:33Z"},{"id":"6222697154","type":"WatchEvent","actor":{"id":4371178,"login":"msching","display_login":"msching","gravatar_id":"","url":"https://api.github.com/users/msching","avatar_url":"https://avatars.githubusercontent.com/u/4371178?"},"repo":{"id":84387539,"name":"efremidze/Magnetic","url":"https://api.github.com/repos/efremidze/Magnetic"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T09:48:26Z"},{"id":"6222696635","type":"WatchEvent","actor":{"id":4371178,"login":"msching","display_login":"msching","gravatar_id":"","url":"https://api.github.com/users/msching","avatar_url":"https://avatars.githubusercontent.com/u/4371178?"},"repo":{"id":84908257,"name":"Ronnel/BubblePicker","url":"https://api.github.com/repos/Ronnel/BubblePicker"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T09:48:21Z"},{"id":"6221966105","type":"WatchEvent","actor":{"id":219689,"login":"lexrus","display_login":"lexrus","gravatar_id":"","url":"https://api.github.com/users/lexrus","avatar_url":"https://avatars.githubusercontent.com/u/219689?"},"repo":{"id":95798441,"name":"athityakumar/colorls","url":"https://api.github.com/repos/athityakumar/colorls"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T07:49:10Z"},{"id":"6221942601","type":"WatchEvent","actor":{"id":219689,"login":"lexrus","display_login":"lexrus","gravatar_id":"","url":"https://api.github.com/users/lexrus","avatar_url":"https://avatars.githubusercontent.com/u/219689?"},"repo":{"id":74459010,"name":"zalando/SwiftMonkey","url":"https://api.github.com/repos/zalando/SwiftMonkey"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T07:44:36Z","org":{"id":1564818,"login":"zalando","gravatar_id":"","url":"https://api.github.com/orgs/zalando","avatar_url":"https://avatars.githubusercontent.com/u/1564818?"}},{"id":"6221307348","type":"WatchEvent","actor":{"id":2911921,"login":"ChenYilong","display_login":"ChenYilong","gravatar_id":"","url":"https://api.github.com/users/ChenYilong","avatar_url":"https://avatars.githubusercontent.com/u/2911921?"},"repo":{"id":93403131,"name":"artemnovichkov/iOS-11-by-Examples","url":"https://api.github.com/repos/artemnovichkov/iOS-11-by-Examples"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-10T04:57:09Z"},{"id":"6219453878","type":"ForkEvent","actor":{"id":10682908,"login":"coderyi","display_login":"coderyi","gravatar_id":"","url":"https://api.github.com/users/coderyi","avatar_url":"https://avatars.githubusercontent.com/u/10682908?"},"repo":{"id":95652496,"name":"olucurious/awesome-arkit","url":"https://api.github.com/repos/olucurious/awesome-arkit"},"payload":{"forkee":{"id":96687559,"name":"awesome-arkit","full_name":"coderyi/awesome-arkit","owner":{"login":"coderyi","id":10682908,"avatar_url":"https://avatars0.githubusercontent.com/u/10682908?v=3","gravatar_id":"","url":"https://api.github.com/users/coderyi","html_url":"https://github.com/coderyi","followers_url":"https://api.github.com/users/coderyi/followers","following_url":"https://api.github.com/users/coderyi/following{/other_user}","gists_url":"https://api.github.com/users/coderyi/gists{/gist_id}","starred_url":"https://api.github.com/users/coderyi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coderyi/subscriptions","organizations_url":"https://api.github.com/users/coderyi/orgs","repos_url":"https://api.github.com/users/coderyi/repos","events_url":"https://api.github.com/users/coderyi/events{/privacy}","received_events_url":"https://api.github.com/users/coderyi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/coderyi/awesome-arkit","description":"A curated list of awesome ARKit projects and resources. Feel free to contribute!","fork":true,"url":"https://api.github.com/repos/coderyi/awesome-arkit","forks_url":"https://api.github.com/repos/coderyi/awesome-arkit/forks","keys_url":"https://api.github.com/repos/coderyi/awesome-arkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/coderyi/awesome-arkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/coderyi/awesome-arkit/teams","hooks_url":"https://api.github.com/repos/coderyi/awesome-arkit/hooks","issue_events_url":"https://api.github.com/repos/coderyi/awesome-arkit/issues/events{/number}","events_url":"https://api.github.com/repos/coderyi/awesome-arkit/events","assignees_url":"https://api.github.com/repos/coderyi/awesome-arkit/assignees{/user}","branches_url":"https://api.github.com/repos/coderyi/awesome-arkit/branches{/branch}","tags_url":"https://api.github.com/repos/coderyi/awesome-arkit/tags","blobs_url":"https://api.github.com/repos/coderyi/awesome-arkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/coderyi/awesome-arkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/coderyi/awesome-arkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/coderyi/awesome-arkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/coderyi/awesome-arkit/statuses/{sha}","languages_url":"https://api.github.com/repos/coderyi/awesome-arkit/languages","stargazers_url":"https://api.github.com/repos/coderyi/awesome-arkit/stargazers","contributors_url":"https://api.github.com/repos/coderyi/awesome-arkit/contributors","subscribers_url":"https://api.github.com/repos/coderyi/awesome-arkit/subscribers","subscription_url":"https://api.github.com/repos/coderyi/awesome-arkit/subscription","commits_url":"https://api.github.com/repos/coderyi/awesome-arkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/coderyi/awesome-arkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/coderyi/awesome-arkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/coderyi/awesome-arkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/coderyi/awesome-arkit/contents/{+path}","compare_url":"https://api.github.com/repos/coderyi/awesome-arkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/coderyi/awesome-arkit/merges","archive_url":"https://api.github.com/repos/coderyi/awesome-arkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/coderyi/awesome-arkit/downloads","issues_url":"https://api.github.com/repos/coderyi/awesome-arkit/issues{/number}","pulls_url":"https://api.github.com/repos/coderyi/awesome-arkit/pulls{/number}","milestones_url":"https://api.github.com/repos/coderyi/awesome-arkit/milestones{/number}","notifications_url":"https://api.github.com/repos/coderyi/awesome-arkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/coderyi/awesome-arkit/labels{/name}","releases_url":"https://api.github.com/repos/coderyi/awesome-arkit/releases{/id}","deployments_url":"https://api.github.com/repos/coderyi/awesome-arkit/deployments","created_at":"2017-07-09T13:54:36Z","updated_at":"2017-07-09T13:40:40Z","pushed_at":"2017-07-05T16:19:53Z","git_url":"git://github.com/coderyi/awesome-arkit.git","ssh_url":"[email protected]:coderyi/awesome-arkit.git","clone_url":"https://github.com/coderyi/awesome-arkit.git","svn_url":"https://github.com/coderyi/awesome-arkit","homepage":null,"size":868,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","public":true}},"public":true,"created_at":"2017-07-09T13:54:36Z"},{"id":"6218999125","type":"WatchEvent","actor":{"id":5144674,"login":"0x5e","display_login":"0x5e","gravatar_id":"","url":"https://api.github.com/users/0x5e","avatar_url":"https://avatars.githubusercontent.com/u/5144674?"},"repo":{"id":7369087,"name":"swisspol/GCDWebServer","url":"https://api.github.com/repos/swisspol/GCDWebServer"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-09T08:59:18Z"},{"id":"6218985900","type":"ForkEvent","actor":{"id":1287724,"login":"zhuhaow","display_login":"zhuhaow","gravatar_id":"","url":"https://api.github.com/users/zhuhaow","avatar_url":"https://avatars.githubusercontent.com/u/1287724?"},"repo":{"id":39840932,"name":"google/googletest","url":"https://api.github.com/repos/google/googletest"},"payload":{"forkee":{"id":96672205,"name":"googletest","full_name":"zhuhaow/googletest","owner":{"login":"zhuhaow","id":1287724,"avatar_url":"https://avatars1.githubusercontent.com/u/1287724?v=3","gravatar_id":"","url":"https://api.github.com/users/zhuhaow","html_url":"https://github.com/zhuhaow","followers_url":"https://api.github.com/users/zhuhaow/followers","following_url":"https://api.github.com/users/zhuhaow/following{/other_user}","gists_url":"https://api.github.com/users/zhuhaow/gists{/gist_id}","starred_url":"https://api.github.com/users/zhuhaow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhuhaow/subscriptions","organizations_url":"https://api.github.com/users/zhuhaow/orgs","repos_url":"https://api.github.com/users/zhuhaow/repos","events_url":"https://api.github.com/users/zhuhaow/events{/privacy}","received_events_url":"https://api.github.com/users/zhuhaow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zhuhaow/googletest","description":"Google Test","fork":true,"url":"https://api.github.com/repos/zhuhaow/googletest","forks_url":"https://api.github.com/repos/zhuhaow/googletest/forks","keys_url":"https://api.github.com/repos/zhuhaow/googletest/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zhuhaow/googletest/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zhuhaow/googletest/teams","hooks_url":"https://api.github.com/repos/zhuhaow/googletest/hooks","issue_events_url":"https://api.github.com/repos/zhuhaow/googletest/issues/events{/number}","events_url":"https://api.github.com/repos/zhuhaow/googletest/events","assignees_url":"https://api.github.com/repos/zhuhaow/googletest/assignees{/user}","branches_url":"https://api.github.com/repos/zhuhaow/googletest/branches{/branch}","tags_url":"https://api.github.com/repos/zhuhaow/googletest/tags","blobs_url":"https://api.github.com/repos/zhuhaow/googletest/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zhuhaow/googletest/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zhuhaow/googletest/git/refs{/sha}","trees_url":"https://api.github.com/repos/zhuhaow/googletest/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zhuhaow/googletest/statuses/{sha}","languages_url":"https://api.github.com/repos/zhuhaow/googletest/languages","stargazers_url":"https://api.github.com/repos/zhuhaow/googletest/stargazers","contributors_url":"https://api.github.com/repos/zhuhaow/googletest/contributors","subscribers_url":"https://api.github.com/repos/zhuhaow/googletest/subscribers","subscription_url":"https://api.github.com/repos/zhuhaow/googletest/subscription","commits_url":"https://api.github.com/repos/zhuhaow/googletest/commits{/sha}","git_commits_url":"https://api.github.com/repos/zhuhaow/googletest/git/commits{/sha}","comments_url":"https://api.github.com/repos/zhuhaow/googletest/comments{/number}","issue_comment_url":"https://api.github.com/repos/zhuhaow/googletest/issues/comments{/number}","contents_url":"https://api.github.com/repos/zhuhaow/googletest/contents/{+path}","compare_url":"https://api.github.com/repos/zhuhaow/googletest/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zhuhaow/googletest/merges","archive_url":"https://api.github.com/repos/zhuhaow/googletest/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zhuhaow/googletest/downloads","issues_url":"https://api.github.com/repos/zhuhaow/googletest/issues{/number}","pulls_url":"https://api.github.com/repos/zhuhaow/googletest/pulls{/number}","milestones_url":"https://api.github.com/repos/zhuhaow/googletest/milestones{/number}","notifications_url":"https://api.github.com/repos/zhuhaow/googletest/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zhuhaow/googletest/labels{/name}","releases_url":"https://api.github.com/repos/zhuhaow/googletest/releases{/id}","deployments_url":"https://api.github.com/repos/zhuhaow/googletest/deployments","created_at":"2017-07-09T08:50:11Z","updated_at":"2017-07-09T04:36:22Z","pushed_at":"2017-07-08T16:00:10Z","git_url":"git://github.com/zhuhaow/googletest.git","ssh_url":"[email protected]:zhuhaow/googletest.git","clone_url":"https://github.com/zhuhaow/googletest.git","svn_url":"https://github.com/zhuhaow/googletest","homepage":"","size":3010,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","public":true}},"public":true,"created_at":"2017-07-09T08:50:11Z","org":{"id":1342004,"login":"google","gravatar_id":"","url":"https://api.github.com/orgs/google","avatar_url":"https://avatars.githubusercontent.com/u/1342004?"}},{"id":"6218895508","type":"WatchEvent","actor":{"id":10682908,"login":"coderyi","display_login":"coderyi","gravatar_id":"","url":"https://api.github.com/users/coderyi","avatar_url":"https://avatars.githubusercontent.com/u/10682908?"},"repo":{"id":93403131,"name":"artemnovichkov/iOS-11-by-Examples","url":"https://api.github.com/repos/artemnovichkov/iOS-11-by-Examples"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-09T07:48:47Z"},{"id":"6218566105","type":"WatchEvent","actor":{"id":435208,"login":"nixzhu","display_login":"nixzhu","gravatar_id":"","url":"https://api.github.com/users/nixzhu","avatar_url":"https://avatars.githubusercontent.com/u/435208?"},"repo":{"id":96159807,"name":"kishikawakatsumi/BookReader","url":"https://api.github.com/repos/kishikawakatsumi/BookReader"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-09T03:25:23Z"},{"id":"6218247516","type":"WatchEvent","actor":{"id":1019875,"login":"onevcat","display_login":"onevcat","gravatar_id":"","url":"https://api.github.com/users/onevcat","avatar_url":"https://avatars.githubusercontent.com/u/1019875?"},"repo":{"id":96223912,"name":"onevcat/github-battle","url":"https://api.github.com/repos/onevcat/github-battle"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-08T23:05:55Z"},{"id":"6218129069","type":"WatchEvent","actor":{"id":1542751,"login":"xxxAIRINxxx","display_login":"xxxAIRINxxx","gravatar_id":"","url":"https://api.github.com/users/xxxAIRINxxx","avatar_url":"https://avatars.githubusercontent.com/u/1542751?"},"repo":{"id":95981267,"name":"DingdingKim/CoinNow","url":"https://api.github.com/repos/DingdingKim/CoinNow"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-08T21:45:27Z"},{"id":"6217345727","type":"CreateEvent","actor":{"id":5144674,"login":"0x5e","display_login":"0x5e","gravatar_id":"","url":"https://api.github.com/users/0x5e","avatar_url":"https://avatars.githubusercontent.com/u/5144674?"},"repo":{"id":96622914,"name":"0x5e/DLNACast","url":"https://api.github.com/repos/0x5e/DLNACast"},"payload":{"ref":null,"ref_type":"repository","master_branch":"master","description":"DLNA screen mirror application in macOS.(In progress)","pusher_type":"user"},"public":true,"created_at":"2017-07-08T14:10:26Z"},{"id":"6217324278","type":"WatchEvent","actor":{"id":5144674,"login":"0x5e","display_login":"0x5e","gravatar_id":"","url":"https://api.github.com/users/0x5e","avatar_url":"https://avatars.githubusercontent.com/u/5144674?"},"repo":{"id":70739248,"name":"cherezov/dlnap","url":"https://api.github.com/repos/cherezov/dlnap"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-08T13:58:11Z"},{"id":"6217239974","type":"WatchEvent","actor":{"id":160165,"login":"wildthink","display_login":"wildthink","gravatar_id":"","url":"https://api.github.com/users/wildthink","avatar_url":"https://avatars.githubusercontent.com/u/160165?"},"repo":{"id":92369115,"name":"CodeEagle/ATML","url":"https://api.github.com/repos/CodeEagle/ATML"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-08T13:04:08Z"},{"id":"6216906308","type":"WatchEvent","actor":{"id":10682908,"login":"coderyi","display_login":"coderyi","gravatar_id":"","url":"https://api.github.com/users/coderyi","avatar_url":"https://avatars.githubusercontent.com/u/10682908?"},"repo":{"id":8180848,"name":"libimobiledevice/ideviceinstaller","url":"https://api.github.com/repos/libimobiledevice/ideviceinstaller"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-08T09:18:33Z","org":{"id":3584568,"login":"libimobiledevice","gravatar_id":"","url":"https://api.github.com/orgs/libimobiledevice","avatar_url":"https://avatars.githubusercontent.com/u/3584568?"}},{"id":"6216401122","type":"WatchEvent","actor":{"id":435208,"login":"nixzhu","display_login":"nixzhu","gravatar_id":"","url":"https://api.github.com/users/nixzhu","avatar_url":"https://avatars.githubusercontent.com/u/435208?"},"repo":{"id":94761104,"name":"jknthn/core-ml-demo","url":"https://api.github.com/repos/jknthn/core-ml-demo"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-08T03:22:16Z"},{"id":"6212695294","type":"WatchEvent","actor":{"id":1019875,"login":"onevcat","display_login":"onevcat","gravatar_id":"","url":"https://api.github.com/users/onevcat","avatar_url":"https://avatars.githubusercontent.com/u/1019875?"},"repo":{"id":83999700,"name":"sdmg15/Best-websites-a-programmer-should-visit","url":"https://api.github.com/repos/sdmg15/Best-websites-a-programmer-should-visit"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-07T14:44:11Z"},{"id":"6211853540","type":"IssuesEvent","actor":{"id":15805487,"login":"commando24","display_login":"commando24","gravatar_id":"","url":"https://api.github.com/users/commando24","avatar_url":"https://avatars.githubusercontent.com/u/15805487?"},"repo":{"id":2514500,"name":"muhku/FreeStreamer","url":"https://api.github.com/repos/muhku/FreeStreamer"},"payload":{"action":"opened","issue":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/362","repository_url":"https://api.github.com/repos/muhku/FreeStreamer","labels_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/362/labels{/name}","comments_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/362/comments","events_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/362/events","html_url":"https://github.com/muhku/FreeStreamer/issues/362","id":241252841,"number":362,"title":"issue with playItem method of FSAudioController","user":{"login":"commando24","id":15805487,"avatar_url":"https://avatars0.githubusercontent.com/u/15805487?v=3","gravatar_id":"","url":"https://api.github.com/users/commando24","html_url":"https://github.com/commando24","followers_url":"https://api.github.com/users/commando24/followers","following_url":"https://api.github.com/users/commando24/following{/other_user}","gists_url":"https://api.github.com/users/commando24/gists{/gist_id}","starred_url":"https://api.github.com/users/commando24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commando24/subscriptions","organizations_url":"https://api.github.com/users/commando24/orgs","repos_url":"https://api.github.com/users/commando24/repos","events_url":"https://api.github.com/users/commando24/events{/privacy}","received_events_url":"https://api.github.com/users/commando24/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-07-07T12:44:12Z","updated_at":"2017-07-07T12:44:12Z","closed_at":null,"body":"I am streaming some urls using \r\n`play(fromPlaylist: playlist, itemIndex: 0)\r\n`\r\nmethod and i am using this below method to change next or previous songs.\r\n`- (void)playItemAtIndex:(NSUInteger)index\r\n`\r\nbut everytime i use above method i get this below error\r\n**[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.**\r\n I suspect that **playItemAtIndex** need some modification like [#265](https://github.com/muhku/FreeStreamer/pull/265)\r\n"}},"public":true,"created_at":"2017-07-07T12:44:13Z"},{"id":"6211721899","type":"IssueCommentEvent","actor":{"id":15805487,"login":"commando24","display_login":"commando24","gravatar_id":"","url":"https://api.github.com/users/commando24","avatar_url":"https://avatars.githubusercontent.com/u/15805487?"},"repo":{"id":2514500,"name":"muhku/FreeStreamer","url":"https://api.github.com/repos/muhku/FreeStreamer"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/223","repository_url":"https://api.github.com/repos/muhku/FreeStreamer","labels_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/223/labels{/name}","comments_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/223/comments","events_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/223/events","html_url":"https://github.com/muhku/FreeStreamer/issues/223","id":118192852,"number":223,"title":"AVAudioSession.mm:697: -[AVAudioSession setActive:withOptions:error:]","user":{"login":"ldjhust","id":3424674,"avatar_url":"https://avatars1.githubusercontent.com/u/3424674?v=3","gravatar_id":"","url":"https://api.github.com/users/ldjhust","html_url":"https://github.com/ldjhust","followers_url":"https://api.github.com/users/ldjhust/followers","following_url":"https://api.github.com/users/ldjhust/following{/other_user}","gists_url":"https://api.github.com/users/ldjhust/gists{/gist_id}","starred_url":"https://api.github.com/users/ldjhust/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldjhust/subscriptions","organizations_url":"https://api.github.com/users/ldjhust/orgs","repos_url":"https://api.github.com/users/ldjhust/repos","events_url":"https://api.github.com/users/ldjhust/events{/privacy}","received_events_url":"https://api.github.com/users/ldjhust/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-11-21T12:07:22Z","updated_at":"2017-07-07T12:20:32Z","closed_at":"2016-01-05T11:57:49Z","body":"I met this error when I switch to the next song:\n\n[AVAudioSession setActive:withOptions:error:]: Deactivating an audio session that has running I/O. All I/O should be stopped or paused prior to deactivating the audio session.\n\nhere is my switch code:\n- (void)nextSong {\n  // 停止正在播放的歌曲\n  [audioStream_ stop];\n  \n  // 初始化歌曲\n  [backgroundView_ songInfoInitial];\n  // 播放歌曲\n  [self playSong];\n  }\n\ncan somebody help me ? very thank you\n"},"comment":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/comments/313666364","html_url":"https://github.com/muhku/FreeStreamer/issues/223#issuecomment-313666364","issue_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/223","id":313666364,"user":{"login":"commando24","id":15805487,"avatar_url":"https://avatars0.githubusercontent.com/u/15805487?v=3","gravatar_id":"","url":"https://api.github.com/users/commando24","html_url":"https://github.com/commando24","followers_url":"https://api.github.com/users/commando24/followers","following_url":"https://api.github.com/users/commando24/following{/other_user}","gists_url":"https://api.github.com/users/commando24/gists{/gist_id}","starred_url":"https://api.github.com/users/commando24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commando24/subscriptions","organizations_url":"https://api.github.com/users/commando24/orgs","repos_url":"https://api.github.com/users/commando24/repos","events_url":"https://api.github.com/users/commando24/events{/privacy}","received_events_url":"https://api.github.com/users/commando24/received_events","type":"User","site_admin":false},"created_at":"2017-07-07T12:20:32Z","updated_at":"2017-07-07T12:20:32Z","body":"@muhku i am still having this issue.\r\ni am using FSAudioController with playlist in which i have set configuration with automaticAudioSessionHandlingEnabled to true."}},"public":true,"created_at":"2017-07-07T12:20:32Z"},{"id":"6210532156","type":"IssueCommentEvent","actor":{"id":15805487,"login":"commando24","display_login":"commando24","gravatar_id":"","url":"https://api.github.com/users/commando24","avatar_url":"https://avatars.githubusercontent.com/u/15805487?"},"repo":{"id":2514500,"name":"muhku/FreeStreamer","url":"https://api.github.com/repos/muhku/FreeStreamer"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/259","repository_url":"https://api.github.com/repos/muhku/FreeStreamer","labels_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/259/labels{/name}","comments_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/259/comments","events_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/259/events","html_url":"https://github.com/muhku/FreeStreamer/pull/259","id":135375508,"number":259,"title":"Issue #258: Make maxRetryCount public","user":{"login":"PatrikBillgren","id":1339530,"avatar_url":"https://avatars0.githubusercontent.com/u/1339530?v=3","gravatar_id":"","url":"https://api.github.com/users/PatrikBillgren","html_url":"https://github.com/PatrikBillgren","followers_url":"https://api.github.com/users/PatrikBillgren/followers","following_url":"https://api.github.com/users/PatrikBillgren/following{/other_user}","gists_url":"https://api.github.com/users/PatrikBillgren/gists{/gist_id}","starred_url":"https://api.github.com/users/PatrikBillgren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PatrikBillgren/subscriptions","organizations_url":"https://api.github.com/users/PatrikBillgren/orgs","repos_url":"https://api.github.com/users/PatrikBillgren/repos","events_url":"https://api.github.com/users/PatrikBillgren/events{/privacy}","received_events_url":"https://api.github.com/users/PatrikBillgren/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-02-22T10:21:50Z","updated_at":"2017-07-07T08:52:04Z","closed_at":"2016-02-22T11:35:10Z","pull_request":{"url":"https://api.github.com/repos/muhku/FreeStreamer/pulls/259","html_url":"https://github.com/muhku/FreeStreamer/pull/259","diff_url":"https://github.com/muhku/FreeStreamer/pull/259.diff","patch_url":"https://github.com/muhku/FreeStreamer/pull/259.patch"},"body":"Hello!\n\nMade this property public and put MainThread-asserts on the getter and setter.\n\nIt should be possible to put this property in the Configuration as well if you'd want to?\n"},"comment":{"url":"https://api.github.com/repos/muhku/FreeStreamer/issues/comments/313625928","html_url":"https://github.com/muhku/FreeStreamer/pull/259#issuecomment-313625928","issue_url":"https://api.github.com/repos/muhku/FreeStreamer/issues/259","id":313625928,"user":{"login":"commando24","id":15805487,"avatar_url":"https://avatars0.githubusercontent.com/u/15805487?v=3","gravatar_id":"","url":"https://api.github.com/users/commando24","html_url":"https://github.com/commando24","followers_url":"https://api.github.com/users/commando24/followers","following_url":"https://api.github.com/users/commando24/following{/other_user}","gists_url":"https://api.github.com/users/commando24/gists{/gist_id}","starred_url":"https://api.github.com/users/commando24/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commando24/subscriptions","organizations_url":"https://api.github.com/users/commando24/orgs","repos_url":"https://api.github.com/users/commando24/repos","events_url":"https://api.github.com/users/commando24/events{/privacy}","received_events_url":"https://api.github.com/users/commando24/received_events","type":"User","site_admin":false},"created_at":"2017-07-07T08:52:04Z","updated_at":"2017-07-07T08:52:04Z","body":"@muhku is it's done ?"}},"public":true,"created_at":"2017-07-07T08:52:04Z"},{"id":"6209228359","type":"WatchEvent","actor":{"id":3031611,"login":"lannik","display_login":"lannik","gravatar_id":"","url":"https://api.github.com/users/lannik","avatar_url":"https://avatars.githubusercontent.com/u/3031611?"},"repo":{"id":48923701,"name":"phimage/CallbackURLKit","url":"https://api.github.com/repos/phimage/CallbackURLKit"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-07T03:22:16Z"},{"id":"6204090972","type":"WatchEvent","actor":{"id":219689,"login":"lexrus","display_login":"lexrus","gravatar_id":"","url":"https://api.github.com/users/lexrus","avatar_url":"https://avatars.githubusercontent.com/u/219689?"},"repo":{"id":77055859,"name":"weixin/WeSketch","url":"https://api.github.com/repos/weixin/WeSketch"},"payload":{"action":"started"},"public":true,"created_at":"2017-07-06T13:30:50Z","org":{"id":14183739,"login":"weixin","gravatar_id":"","url":"https://api.github.com/orgs/weixin","avatar_url":"https://avatars.githubusercontent.com/u/14183739?"}},{"id":"6202669694","type":"ForkEvent","actor":{"id":8609851,"login":"lookingstars","display_login":"lookingstars","gravatar_id":"","url":"https://api.github.com/users/lookingstars","avatar_url":"https://avatars.githubusercontent.com/u/8609851?"},"repo":{"id":88714127,"name":"ksvc/KSYMediaEditorKit_iOS","url":"https://api.github.com/repos/ksvc/KSYMediaEditorKit_iOS"},"payload":{"forkee":{"id":96414822,"name":"KSYMediaEditorKit_iOS","full_name":"lookingstars/KSYMediaEditorKit_iOS","owner":{"login":"lookingstars","id":8609851,"avatar_url":"https://avatars1.githubusercontent.com/u/8609851?v=3","gravatar_id":"","url":"https://api.github.com/users/lookingstars","html_url":"https://github.com/lookingstars","followers_url":"https://api.github.com/users/lookingstars/followers","following_url":"https://api.github.com/users/lookingstars/following{/other_user}","gists_url":"https://api.github.com/users/lookingstars/gists{/gist_id}","starred_url":"https://api.github.com/users/lookingstars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lookingstars/subscriptions","organizations_url":"https://api.github.com/users/lookingstars/orgs","repos_url":"https://api.github.com/users/lookingstars/repos","events_url":"https://api.github.com/users/lookingstars/events{/privacy}","received_events_url":"https://api.github.com/users/lookingstars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lookingstars/KSYMediaEditorKit_iOS","description":"金山云短视频编辑SDK iOS版本. Video editor SDK powered by KSYUN, which makes it easy to capture, create, view and share your clips and playback anywhere.","fork":true,"url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS","forks_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/forks","keys_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/teams","hooks_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/hooks","issue_events_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/issues/events{/number}","events_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/events","assignees_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/assignees{/user}","branches_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/branches{/branch}","tags_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/tags","blobs_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/git/refs{/sha}","trees_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/statuses/{sha}","languages_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/languages","stargazers_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/stargazers","contributors_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/contributors","subscribers_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/subscribers","subscription_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/subscription","commits_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/commits{/sha}","git_commits_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/git/commits{/sha}","comments_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/comments{/number}","issue_comment_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/issues/comments{/number}","contents_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/contents/{+path}","compare_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/merges","archive_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/downloads","issues_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/issues{/number}","pulls_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/pulls{/number}","milestones_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/milestones{/number}","notifications_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/labels{/name}","releases_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/releases{/id}","deployments_url":"https://api.github.com/repos/lookingstars/KSYMediaEditorKit_iOS/deployments","created_at":"2017-07-06T09:46:49Z","updated_at":"2017-07-06T09:46:47Z","pushed_at":"2017-07-06T08:43:04Z","git_url":"git://github.com/lookingstars/KSYMediaEditorKit_iOS.git","ssh_url":"[email protected]:lookingstars/KSYMediaEditorKit_iOS.git","clone_url":"https://github.com/lookingstars/KSYMediaEditorKit_iOS.git","svn_url":"https://github.com/lookingstars/KSYMediaEditorKit_iOS","homepage":"https://v.ksyun.com","size":194271,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master","public":true}},"public":true,"created_at":"2017-07-06T09:46:49Z","org":{"id":16359966,"login":"ksvc","gravatar_id":"","url":"https://api.github.com/orgs/ksvc","avatar_url":"https://avatars.githubusercontent.com/u/16359966?"}}]

Flat Json, CoreData, support Optional and Requeried fields

Can you generate something like that?

JSON:

{
    "id": 42,
    "name": "nixzhu",
    "twitter": {
        "profile_url": "https://twitter.com/nixzhu",
        "created_at": "2009-05-12T10:25:43.511Z"
    }
}

Class Codable:

import Foundation

// "XXX" prefix of each class of the application
public class XXXUser: Codable {
    
    public enum CodingKeys: String, CodingKey {
        // Fields define on the json
        case id
        case name
        case twitter

        // Fields for flat version
        case profileUrl
        case createdAt
    }

    // Use only internally to extact sub-structs
    private class Twitter: Codable {
        public enum CodingKeys: String, CodingKey {
            case profileUrl = "profil_url"
            case createdAt = "created_at"
        }

        public var profileUrl: String = ""
        public var createdAt: Date = Date.distantPast
    }
    
    public var id:Int16 = 0
    public var name:String = ""
    public var profileUrl: String = ""
    public var createdAt: Date = Date.distantPast
    
    public init() {
    }
    
    // MARK: -> Public protocol Encodable
    
    public func encode(to pEncoder: Encoder) throws {
        var lContainer = pEncoder.container(keyedBy: CodingKeys.self)
        
        try lContainer.encode(self.id, forKey: .id)
        try lContainer.encode(self.name, forKey: .name)
        try lContainer.encode(self.profileUrl, forKey: .profileUrl)
        try lContainer.encode(self.createdAt, forKey: .createdAt)
    }

    // MARK: -> Public protocol Decodable
    
    public required init(from pDecoder: Decoder) throws {
        if let lContainer = try? pDecoder.container(keyedBy: CodingKeys.self) {
            var lInvalidFields:[String] = []
            
            // Required
            if let lId = try? lContainer.decode(Int.self, forKey: .id) {
                self.id = lId
            } else {
                lInvalidFields.append(CodingKeys.id.stringValue)
            }
            
            // Required
            if let lName = try? lContainer.decode(String.self, forKey: .name) {
                self.name = lName
            } else {
                lInvalidFields.append(CodingKeys.name.stringValue)
            }
            
            // Optional
            if let lTwitter = try? lContainer.decode(Twitter.self, forKey: .twitter) {
                self.profileUrl = lTwitter.profileUrl
                self.createdAt = lTwitter.createdAt
            }
            
            // Store object in CoreData when all required fields are valid
            // otherwise ignore record and generate an output on debug mode
            if lInvalidFields.isEmpty {
                CDUser.setup(id: self.id, name: self.name, profileUrl: self.profileUrl, createdAt: self.createdAt)
            } else {
                #if DEBUG
                    // lData.json format Data to a json string
                    if let lData = try? JSONEncoder().encode(self), let lJsonValue = lData.json(format: true, padding: "  ") {
                        print("\n\(type(of: self)): Invalid fields:\n  [\(lInvalidFields.joined(separator: ","))]\nValue:\n\(lJsonValue)\n")
                    }
                #endif
            }
        } else {
            #if DEBUG
                print("\(type(of: self)): Invalid data")
            #endif
        }
    }
}

Class CoreData:

import Foundation
import CoreData

// "CD" for CoreData 
@objc(CDUser)
open class CDUser: NSManagedObject {
    
    @NSManaged public var id: Int16
    @NSManaged public var name: String
    @NSManaged public var profileUrl: String
    @NSManaged public var createdAt: Date

    public static func setup(id pId: Int16,
                             name pName: String,
                             profileUrl pProfileUrl: String,
                             createdAt pCreatedAt: Date)
    {
        // App.database is a CoreData layer abstraction object
        
        // Check if the object exist
        guard let lInstance = App.database.objectFor(entity: "CDUser", id: pId) as? CDUser else {
            
            // Object doesn't exists, create a new CoreData instance of CDUser
            let lNew = App.database.instance(CDUser.self)
            
            // Set properties of new CoreData object of CDUser
            lNew.properties(id: pId, name: pName, profileUrl: pProfileUrl, price: pPrice, position: pPosition)
            return
        }
        
        // Object already exists, we only update his properties
        lInstance.properties(id: pId, name: pName, profileUrl: pProfileUrl, createdAt: pCreatedAt)
    }
    
    public func properties(id pId: Int16,
                           name pName: String,
                           profileUrl pProfileUrl: String,
                           createdAt pCreatedAt: Date)
    {
        self.id = pId
        self.name = pName
        self.profileUrl = pProfileUrl
        self.createdAt = pCreatedAt
        
        // Save data in CoreData
        App.database.save()
    }
}

property map could Generate two Sturcts?

Briefly describe your problem when use Baby.

JSON String

{
    "resultCode": "0",
    "resultDesc": "success",
    "resultData": {
        "userName": "美嘉",
        "userType": "院线用户 或 影院用户",
        "cinemaAllName": "北京中关村店,美嘉三里屯店,沈阳万象店"
    }
}

I used CuteBay ver1.3.5 on macOS. Generate code like this.

property map set as resultData: User

struct BaseModel: Codable {
    let resultCode: String
    let resultDesc: String
    struct ResultData: Codable {
        let userName: String
        let userType: String
        let cinemaAllName: String
    }
    let User: ResultData
    private enum CodingKeys: String, CodingKey {
        case resultCode
        case resultDesc
        case User = "resultData"
    }
}

I prefer the Code like this

struct User: Codable {
    let userName: String
    let userType: String
    let cinemaAllName: String
}
struct BaseModel: Codable {
    let resultCode: String
    let resultDesc: String
    let User: User
    private enum CodingKeys: String, CodingKey {
        case resultCode
        case resultDesc
        case User = "resultData"
    }
}

Could you please add new feature to Custom set it

The JSON crashing the Shared Baby.

Briefly describe your problem when use Baby.

JSON String

{
	"ret": 200,
	"result": {
		"code": "1",
		"msg": "获取内容成功",
		"info": [
			{
				"content_id": "24",
				"content_title": null,
				"content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/xxxxxx.png",
				"content_smallImgSrc": "",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "118",
						"label_title": "AAA",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "25",
				"content_title": null,
				"content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/xxxxxx.png",
				"content_smallImgSrc": "",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "118",
						"label_title": "AAA",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "28",
				"content_title": null,
				"content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/xxxxxx.png",
				"content_smallImgSrc": "",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "119",
						"label_title": "Angelica",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "29",
				"content_title": null,
				"content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/xxxxxx.png",
				"content_smallImgSrc": "",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "119",
						"label_title": "Angelica",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "30",
				"content_title": null,
				"content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/xxxxxx.png",
				"content_smallImgSrc": "",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "119",
						"label_title": "Angelica",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "3",
				"content_title": "lilinkai11111",
				"content_imgsrc": "www.baidu.com",
				"content_smallImgSrc": "www.baidu.com",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "111",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "112",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "113",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "4",
				"content_title": "lilinkai11111",
				"content_imgsrc": "www.baidu.com",
				"content_smallImgSrc": "www.baidu.com",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "111",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "112",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "113",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "5",
				"content_title": "lilinkai11111",
				"content_imgsrc": "www.baidu.com",
				"content_smallImgSrc": "www.baidu.com",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "111",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "112",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "113",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "6",
				"content_title": "lilinkai11111",
				"content_imgsrc": "www.baidu.com",
				"content_smallImgSrc": "www.baidu.com",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "111",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "112",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "113",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					}
				]
			},
			{
				"content_id": "7",
				"content_title": "lilinkai11111",
				"content_imgsrc": "www.baidu.com",
				"content_smallImgSrc": "www.baidu.com",
				"img_width": "666",
				"img_height": "666",
				"labels": [
					{
						"label_id": "111",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "112",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					},
					{
						"label_id": "113",
						"label_title": "哈哈哈",
						"label_likeNum": "0"
					}
				]
			}
		],
		"pageModel": []
	},
	"msg": ""
}

Can't hide `Write a review`.

Briefly describe your problem when use Baby.

JSON String

{
  "id": 300,
  "name": "Luna Sofa",
  "slug": "luna-sofa",
  "description": "The Luna collection designed in collaboration with Krystian Kowalski is a masterclass in design subtlety. The gentle curvature of the Luna sofa’s back rest is reinforced with the use of soft kidney cushions helping to create an extremely comfortable piece. The flowing lines of the Luna sofa are highlighted by fine piping, allowing you to trace its form easily. The black band at the base is the iconic design trait for this whole collection, this also helps to increase its structural integrity too. The blade legs are the finishing touches to a modern, contemporary collection that is timeless.",
  "product_type": "configurable",
  "price": "1199.0",
  "list_price": "1199.0",
  "tags": [

  ],
  "max_sale_qty": 1000,
  "min_sale_qty": 1,
  "qty_increments": 1,
  "show_free_swatch": true,
  "product_layout": "configurable",
  "typical_retail_price": "1799.0",
  "meta_title": "",
  "meta_description": "",
  "meta_keywords": "",
  "available_on": "2017-06-04T00:00:00.000+10:00",
  "variants": [
    {
      "id": 3149,
      "name": "Luna Sofa, Iron Gray",
      "sku": "50440374-VC4002",
      "price": "1199.0",
      "list_price": "1199.0",
      "typical_retail_price": "1799.0",
      "product_id": 300,
      "product_slug": "luna-sofa",
      "cms_contents": [
        {
          "id": 2990,
          "content": "[{"name":"Images","model":[{"images":[{"id":"_j499kgfh4yrbe","url":"https://res.cloudinary.com/castlery/image/upload/v1498186513/knight/cms/luna-collection-lifestyle.jpg","alt":"","ratio":0.6666666666666666,"caption":"The Luna collection in collaboration with Krystian Kowalski is modern, chic and timeless. It’s extremely fine radiuses are perfectly calculated, making this a master class in design subtlety.","captionAlign":"center"},{"caption":"The gentle curvature of the Luna sofas back rest is reinforced with the use of soft kidney cushions.","id":"2811187505213","captionAlign":"center","alt":"luna-sofa-base-iron-gray-SB","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636095/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-SB.jpg"},{"caption":"The fine piping outlines the silhouette of the piece, giving form to its curves.","id":"7699261307800","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C1","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636099/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C1.jpg"},{"caption":"The slight division on the back rest helps to visually balance the sofa, helping to lighten it.","id":"4703261936434","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C2","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636102/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C2.jpg"},{"caption":"The black metal band wraps around the curved base giving the piece gravity.","id":"4721835259635","captionAlign":"center","alt":"luna-sofa-base-iron-gray-SB1","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636106/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-SB1.jpg"},{"caption":"The black metal band connects beautifully with the seat cushion and black blade legs.","id":"6486660021472","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C3","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636109/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C3.jpg"},{"caption":"The front blade legs are in line with the arm's piping creating a seamless connection between the sofa and its legs.","id":"0210281665090","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C4","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636112/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C4.jpg"}],"mediaQuery":[0,991],"rowControls":[1,1,2,1,2]},{"images":[{"id":"_j499kgfh4yrbe","url":"https://res.cloudinary.com/castlery/image/upload/v1498186513/knight/cms/luna-collection-lifestyle.jpg","alt":"","ratio":0.6666666666666666,"caption":"The Luna collection in collaboration with Krystian Kowalski is modern, chic and timeless. It’s extremely fine radiuses are perfectly calculated, making this a master class in design subtlety.","captionAlign":"center"},{"caption":"The gentle curvature of the Luna sofas back rest is reinforced with the use of soft kidney cushions.","id":"2811187505213","captionAlign":"center","alt":"luna-sofa-base-iron-gray-SB","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636095/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-SB.jpg"},{"caption":"The fine piping outlines the silhouette of the piece, giving form to its curves.","id":"7699261307800","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C1","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636099/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C1.jpg"},{"caption":"The slight division on the back rest helps to visually balance the sofa, helping to lighten it.","id":"4703261936434","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C2","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636102/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C2.jpg"},{"caption":"The black metal band wraps around the curved base giving the piece gravity.","id":"4721835259635","captionAlign":"center","alt":"luna-sofa-base-iron-gray-SB1","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636106/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-SB1.jpg"},{"caption":"The black metal band connects beautifully with the seat cushion and black blade legs.","id":"6486660021472","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C3","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636109/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C3.jpg"},{"caption":"The front blade legs are in line with the arm's piping creating a seamless connection between the sofa and its legs.","id":"0210281665090","captionAlign":"left","alt":"luna-sofa-base-iron-gray-C4","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636112/knight/cms/sofas-armchairs/luna-sofa/iron-gray/luna-sofa-base-iron-gray-C4.jpg"}],"mediaQuery":[992],"rowControls":[1,1,2,1,2]}]}]",
          "is_shared": false,
          "created_at": "2017-06-05T14:16:20.339+10:00",
          "updated_at": "2017-09-06T20:07:15.169+10:00",
          "name": "luna sofa base iron gray"
        }
      ],
      "is_customized": false,
      "product_name": "Luna Sofa",
      "images": [
        {
          "id": 3887,
          "position": 1,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3887/mini/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3887/mini_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "small": "https://img-stag.castlery.com.au/products/images/3887/small/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3887/small_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "medium": "https://img-stag.castlery.com.au/products/images/3887/medium/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3887/medium_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "large": "https://img-stag.castlery.com.au/products/images/3887/large/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3887/large_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3887/mini_x2/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3887/mini_x2_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3887/small_x2/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3887/small_x2_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3887/medium_x2/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3887/medium_x2_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3887/large_x2/AU-luna-sofa-iron-gray-front.jpg?1496635616",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3887/large_x2_gray/AU-luna-sofa-iron-gray-front.jpg?1496635616"
          },
          "alt": ""
        },
        {
          "id": 3888,
          "position": 2,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3888/mini/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3888/mini_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "small": "https://img-stag.castlery.com.au/products/images/3888/small/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3888/small_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "medium": "https://img-stag.castlery.com.au/products/images/3888/medium/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3888/medium_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "large": "https://img-stag.castlery.com.au/products/images/3888/large/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3888/large_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3888/mini_x2/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3888/mini_x2_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3888/small_x2/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3888/small_x2_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3888/medium_x2/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3888/medium_x2_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3888/large_x2/AU-luna-sofa-iron-gray-angle.jpg?1496635616",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3888/large_x2_gray/AU-luna-sofa-iron-gray-angle.jpg?1496635616"
          },
          "alt": ""
        },
        {
          "id": 3882,
          "position": 3,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3882/mini/AU-luna-sofa-side.jpg?1496635613",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3882/mini_gray/AU-luna-sofa-side.jpg?1496635613",
            "small": "https://img-stag.castlery.com.au/products/images/3882/small/AU-luna-sofa-side.jpg?1496635613",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3882/small_gray/AU-luna-sofa-side.jpg?1496635613",
            "medium": "https://img-stag.castlery.com.au/products/images/3882/medium/AU-luna-sofa-side.jpg?1496635613",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3882/medium_gray/AU-luna-sofa-side.jpg?1496635613",
            "large": "https://img-stag.castlery.com.au/products/images/3882/large/AU-luna-sofa-side.jpg?1496635613",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3882/large_gray/AU-luna-sofa-side.jpg?1496635613",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3882/mini_x2/AU-luna-sofa-side.jpg?1496635613",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3882/mini_x2_gray/AU-luna-sofa-side.jpg?1496635613",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3882/small_x2/AU-luna-sofa-side.jpg?1496635613",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3882/small_x2_gray/AU-luna-sofa-side.jpg?1496635613",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3882/medium_x2/AU-luna-sofa-side.jpg?1496635613",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3882/medium_x2_gray/AU-luna-sofa-side.jpg?1496635613",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3882/large_x2/AU-luna-sofa-side.jpg?1496635613",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3882/large_x2_gray/AU-luna-sofa-side.jpg?1496635613"
          },
          "alt": ""
        },
        {
          "id": 3884,
          "position": 4,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3884/mini/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3884/mini_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "small": "https://img-stag.castlery.com.au/products/images/3884/small/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3884/small_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "medium": "https://img-stag.castlery.com.au/products/images/3884/medium/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3884/medium_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "large": "https://img-stag.castlery.com.au/products/images/3884/large/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3884/large_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3884/mini_x2/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3884/mini_x2_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3884/small_x2/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3884/small_x2_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3884/medium_x2/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3884/medium_x2_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3884/large_x2/AU-luna-sofa-iron-gray-back.jpg?1496635615",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3884/large_x2_gray/AU-luna-sofa-iron-gray-back.jpg?1496635615"
          },
          "alt": ""
        }
      ],
      "variant_option_values": [
        {
          "option_value_id": 136,
          "name": "iron_gray",
          "presentation": "Iron Gray",
          "option_type_id": 1,
          "option_type_name": "material",
          "option_type_presentation": "Material"
        }
      ],
      "variant_properties": {
        "product_details": [
          {
            "name": "fabric_composition",
            "presentation": "Fabric Composition",
            "value": "100% Polyester"
          }
        ],
        "product_dimensions": [

        ],
        "delivery_returns": [

        ],
        "comfort_ratings": [

        ]
      },
      "dimension_image": {
        "id": 3890,
        "position": 5,
        "links": {
          "mini": "https://img-stag.castlery.com.au/products/images/3890/mini/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "mini_gray": "https://img-stag.castlery.com.au/products/images/3890/mini_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "small": "https://img-stag.castlery.com.au/products/images/3890/small/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "small_gray": "https://img-stag.castlery.com.au/products/images/3890/small_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "medium": "https://img-stag.castlery.com.au/products/images/3890/medium/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "medium_gray": "https://img-stag.castlery.com.au/products/images/3890/medium_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "large": "https://img-stag.castlery.com.au/products/images/3890/large/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "large_gray": "https://img-stag.castlery.com.au/products/images/3890/large_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "mini_x2": "https://img-stag.castlery.com.au/products/images/3890/mini_x2/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3890/mini_x2_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "small_x2": "https://img-stag.castlery.com.au/products/images/3890/small_x2/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3890/small_x2_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "medium_x2": "https://img-stag.castlery.com.au/products/images/3890/medium_x2/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3890/medium_x2_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "large_x2": "https://img-stag.castlery.com.au/products/images/3890/large_x2/AU-luna-sofa-iron-gray-dim.jpg?1496635749",
          "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3890/large_x2_gray/AU-luna-sofa-iron-gray-dim.jpg?1496635749"
        },
        "alt": ""
      }
    },
    {
      "id": 3150,
      "name": "Luna Sofa, Parchment Beige",
      "sku": "50440374-VC4001",
      "price": "1199.0",
      "list_price": "1199.0",
      "typical_retail_price": "1799.0",
      "product_id": 300,
      "product_slug": "luna-sofa",
      "cms_contents": [
        {
          "id": 2989,
          "content": "[{"name":"Images","model":[{"images":[{"id":"_j499mf7lpn2jp","url":"https://res.cloudinary.com/castlery/image/upload/v1498186513/knight/cms/luna-collection-lifestyle.jpg","alt":"","ratio":0.6666666666666666,"caption":"The Luna collection in collaboration with Krystian Kowalski is modern, chic and timeless. Its extremely fine radiuses are perfectly calculated, making this a master class in design subtlety.","captionAlign":"center"},{"caption":"The gentle curvature of the Luna sofas back rest is reinforced with the use of soft kidney cushions.","id":"2715596254789","captionAlign":"center","alt":"luna-sofa-base-parchment-beige-SB","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636073/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-SB.jpg"},{"caption":"The fine piping outlines the silhouette of the piece, giving form to its curves.","id":"1597427462614","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C1","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636077/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C1.jpg"},{"caption":"The slight division on the back rest helps to visually balance the sofa, helping to lighten it.","id":"8796022400134","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C2","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636081/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C2.jpg"},{"caption":"The black metal band wraps around the curved base giving the piece gravity.","id":"6859908457843","captionAlign":"center","alt":"luna-sofa-base-parchment-beige-SB1","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636084/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-SB1.jpg"},{"caption":"The black metal band connects beautifully with the seat cushion and black blade legs.","id":"0461482652154","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C3","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636088/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C3.jpg"},{"caption":"The front blade legs are in line with the arm's piping creating a seamless connection between the sofa and its legs.","id":"5904631334631","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C4","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636091/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C4.jpg"}],"mediaQuery":[0,991],"rowControls":[1,1,2,1,2]},{"images":[{"id":"_j499mf7lpn2jp","url":"https://res.cloudinary.com/castlery/image/upload/v1498186513/knight/cms/luna-collection-lifestyle.jpg","alt":"","ratio":0.6666666666666666,"caption":"The Luna collection in collaboration with Krystian Kowalski is modern, chic and timeless. Its extremely fine radiuses are perfectly calculated, making this a master class in design subtlety.","captionAlign":"center"},{"caption":"The gentle curvature of the Luna sofas back rest is reinforced with the use of soft kidney cushions.","id":"2715596254789","captionAlign":"center","alt":"luna-sofa-base-parchment-beige-SB","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636073/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-SB.jpg"},{"caption":"The fine piping outlines the silhouette of the piece, giving form to its curves.","id":"1597427462614","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C1","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636077/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C1.jpg"},{"caption":"The slight division on the back rest helps to visually balance the sofa, helping to lighten it.","id":"8796022400134","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C2","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636081/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C2.jpg"},{"caption":"The black metal band wraps around the curved base giving the piece gravity.","id":"6859908457843","captionAlign":"center","alt":"luna-sofa-base-parchment-beige-SB1","ratio":0.5844611528822055,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636084/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-SB1.jpg"},{"caption":"The black metal band connects beautifully with the seat cushion and black blade legs.","id":"0461482652154","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C3","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636088/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C3.jpg"},{"caption":"The front blade legs are in line with the arm's piping creating a seamless connection between the sofa and its legs.","id":"5904631334631","captionAlign":"left","alt":"luna-sofa-base-parchment-beige-C4","ratio":0.585,"url":"https://res.cloudinary.com/castlery/image/upload/v1496636091/knight/cms/sofas-armchairs/luna-sofa/parchment-beige/luna-sofa-base-parchment-beige-C4.jpg"}],"mediaQuery":[992],"rowControls":[1,1,2,1,2]}]}]",
          "is_shared": false,
          "created_at": "2017-06-05T14:16:08.937+10:00",
          "updated_at": "2017-09-06T20:07:18.049+10:00",
          "name": "luna sofa base parchment beige"
        }
      ],
      "is_customized": false,
      "product_name": "Luna Sofa",
      "images": [
        {
          "id": 3885,
          "position": 1,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3885/mini/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3885/mini_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "small": "https://img-stag.castlery.com.au/products/images/3885/small/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3885/small_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "medium": "https://img-stag.castlery.com.au/products/images/3885/medium/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3885/medium_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "large": "https://img-stag.castlery.com.au/products/images/3885/large/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3885/large_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3885/mini_x2/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3885/mini_x2_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3885/small_x2/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3885/small_x2_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3885/medium_x2/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3885/medium_x2_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3885/large_x2/AU-luna-sofa-parchment-beige-front.jpg?1496635615",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3885/large_x2_gray/AU-luna-sofa-parchment-beige-front.jpg?1496635615"
          },
          "alt": ""
        },
        {
          "id": 3886,
          "position": 2,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3886/mini/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3886/mini_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "small": "https://img-stag.castlery.com.au/products/images/3886/small/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3886/small_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "medium": "https://img-stag.castlery.com.au/products/images/3886/medium/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3886/medium_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "large": "https://img-stag.castlery.com.au/products/images/3886/large/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3886/large_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3886/mini_x2/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3886/mini_x2_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3886/small_x2/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3886/small_x2_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3886/medium_x2/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3886/medium_x2_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3886/large_x2/AU-luna-sofa-parchment-beige-angle.jpg?1496635616",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3886/large_x2_gray/AU-luna-sofa-parchment-beige-angle.jpg?1496635616"
          },
          "alt": ""
        },
        {
          "id": 3881,
          "position": 3,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3881/mini/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3881/mini_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "small": "https://img-stag.castlery.com.au/products/images/3881/small/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3881/small_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "medium": "https://img-stag.castlery.com.au/products/images/3881/medium/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3881/medium_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "large": "https://img-stag.castlery.com.au/products/images/3881/large/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3881/large_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3881/mini_x2/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3881/mini_x2_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3881/small_x2/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3881/small_x2_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3881/medium_x2/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3881/medium_x2_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3881/large_x2/AU-luna-sofa-parchment-beige-side.jpg?1496635612",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3881/large_x2_gray/AU-luna-sofa-parchment-beige-side.jpg?1496635612"
          },
          "alt": ""
        },
        {
          "id": 3883,
          "position": 4,
          "links": {
            "mini": "https://img-stag.castlery.com.au/products/images/3883/mini/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "mini_gray": "https://img-stag.castlery.com.au/products/images/3883/mini_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "small": "https://img-stag.castlery.com.au/products/images/3883/small/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "small_gray": "https://img-stag.castlery.com.au/products/images/3883/small_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "medium": "https://img-stag.castlery.com.au/products/images/3883/medium/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "medium_gray": "https://img-stag.castlery.com.au/products/images/3883/medium_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "large": "https://img-stag.castlery.com.au/products/images/3883/large/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "large_gray": "https://img-stag.castlery.com.au/products/images/3883/large_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "mini_x2": "https://img-stag.castlery.com.au/products/images/3883/mini_x2/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3883/mini_x2_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "small_x2": "https://img-stag.castlery.com.au/products/images/3883/small_x2/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3883/small_x2_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "medium_x2": "https://img-stag.castlery.com.au/products/images/3883/medium_x2/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3883/medium_x2_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "large_x2": "https://img-stag.castlery.com.au/products/images/3883/large_x2/AU-luna-sofa-parchment-beige-back.jpg?1496635614",
            "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3883/large_x2_gray/AU-luna-sofa-parchment-beige-back.jpg?1496635614"
          },
          "alt": ""
        }
      ],
      "variant_option_values": [
        {
          "option_value_id": 137,
          "name": "parchment_beige",
          "presentation": "Parchment Beige",
          "option_type_id": 1,
          "option_type_name": "material",
          "option_type_presentation": "Material"
        }
      ],
      "variant_properties": {
        "product_details": [
          {
            "name": "fabric_composition",
            "presentation": "Fabric Composition",
            "value": "100% Polyester"
          }
        ],
        "product_dimensions": [

        ],
        "delivery_returns": [

        ],
        "comfort_ratings": [

        ]
      },
      "dimension_image": {
        "id": 3889,
        "position": 5,
        "links": {
          "mini": "https://img-stag.castlery.com.au/products/images/3889/mini/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "mini_gray": "https://img-stag.castlery.com.au/products/images/3889/mini_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "small": "https://img-stag.castlery.com.au/products/images/3889/small/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "small_gray": "https://img-stag.castlery.com.au/products/images/3889/small_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "medium": "https://img-stag.castlery.com.au/products/images/3889/medium/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "medium_gray": "https://img-stag.castlery.com.au/products/images/3889/medium_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "large": "https://img-stag.castlery.com.au/products/images/3889/large/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "large_gray": "https://img-stag.castlery.com.au/products/images/3889/large_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "mini_x2": "https://img-stag.castlery.com.au/products/images/3889/mini_x2/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "mini_x2_gray": "https://img-stag.castlery.com.au/products/images/3889/mini_x2_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "small_x2": "https://img-stag.castlery.com.au/products/images/3889/small_x2/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "small_x2_gray": "https://img-stag.castlery.com.au/products/images/3889/small_x2_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "medium_x2": "https://img-stag.castlery.com.au/products/images/3889/medium_x2/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "medium_x2_gray": "https://img-stag.castlery.com.au/products/images/3889/medium_x2_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "large_x2": "https://img-stag.castlery.com.au/products/images/3889/large_x2/AU-luna-sofa-parchment-beige-dim.jpg?1496635749",
          "large_x2_gray": "https://img-stag.castlery.com.au/products/images/3889/large_x2_gray/AU-luna-sofa-parchment-beige-dim.jpg?1496635749"
        },
        "alt": ""
      }
    }
  ],
  "taxons": [
    {
      "name": "Sofas",
      "permalink": "living-room/sofas",
      "position": 2,
      "level": 2,
      "value": "Sofas",
      "ancestors": [
        "Category",
        "Living Room"
      ]
    },
    {
      "name": "Luna Collection",
      "permalink": "luna-collection",
      "position": 3,
      "level": 1,
      "value": "Luna Collection",
      "ancestors": [
        "Collections"
      ]
    },
    {
      "name": "Collections",
      "permalink": "collections",
      "position": 106,
      "level": 0,
      "value": "Collections",
      "ancestors": [

      ]
    },
    {
      "name": "Living Room",
      "permalink": "living-room",
      "position": 153,
      "level": 1,
      "value": "Living Room",
      "ancestors": [
        "Category"
      ]
    },
    {
      "name": "Category",
      "permalink": "category",
      "position": 274,
      "level": 0,
      "value": "Category",
      "ancestors": [

      ]
    }
  ],
  "images": [

  ],
  "product_properties": {
    "product_details": [
      {
        "name": "frame",
        "presentation": "Frame",
        "value": "Solid Wood with Plywood"
      },
      {
        "name": "fabric_composition",
        "presentation": "Fabric Composition",
        "value": "100% Polyester"
      },
      {
        "name": "leg",
        "presentation": "Leg",
        "value": "Powder Coated Metal"
      },
      {
        "name": "firmness",
        "presentation": "Firmness",
        "value": "Medium-Firm"
      },
      {
        "name": "filling",
        "presentation": "Filling",
        "value": "Foam with Pocket Spring Seating and Fibre Filled Back Cushion"
      },
      {
        "name": "suspension",
        "presentation": "Suspension",
        "value": "Zigzag Spring"
      },
      {
        "name": "cover_type",
        "presentation": "Cover Type",
        "value": "Fixed"
      }
    ],
    "product_dimensions": [
      {
        "name": "general_dimensions",
        "presentation": "Dimension",
        "value": "W212.5 x D79.5 x H83cm"
      },
      {
        "name": "seating_depth",
        "presentation": "Seating Depth",
        "value": "52cm"
      },
      {
        "name": "leg_height",
        "presentation": "Leg Height",
        "value": "22cm"
      },
      {
        "name": "seatable_width",
        "presentation": "Seatable Width",
        "value": "158cm"
      },
      {
        "name": "seating_height",
        "presentation": "Seating Height",
        "value": "47.5cm"
      }
    ],
    "delivery_returns": [

    ],
    "comfort_ratings": [
      {
        "name": "overall_sit_rating",
        "presentation": "Overall Sit",
        "value": "2"
      },
      {
        "name": "seat_depth_rating",
        "presentation": "Seat Depth",
        "value": "2"
      },
      {
        "name": "seat_height_rating",
        "presentation": "Seat Height",
        "value": "4"
      },
      {
        "name": "seat_softness_rating",
        "presentation": "Seat Softness",
        "value": "4"
      }
    ]
  },
  "cms_contents": [

  ],
  "related_products": [

  ],
  "cross_sell": [

  ],
  "collections": [
    302,
    301
  ],
  "recommended_bundles": [

  ],
  "option_types": [
    {
      "id": 1,
      "name": "material",
      "presentation": "Material",
      "values": [
        {
          "id": 1,
          "name": "light_gray",
          "presentation": "Light Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/light-gray.png"
        },
        {
          "id": 2,
          "name": "charcoal",
          "presentation": "Charcoal",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/charcoal.png"
        },
        {
          "id": 3,
          "name": "teal",
          "presentation": "Teal",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/teal.png"
        },
        {
          "id": 4,
          "name": "oxford_blue",
          "presentation": "Oxford Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/oxford-blue.png"
        },
        {
          "id": 6,
          "name": "silver_gray",
          "presentation": "Silver Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/silver-gray.png"
        },
        {
          "id": 7,
          "name": "dark_gray",
          "presentation": "Dark Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/dark-gray.png"
        },
        {
          "id": 8,
          "name": "coral_blue",
          "presentation": "Coral Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/coral-blue.png"
        },
        {
          "id": 9,
          "name": "navy_blue",
          "presentation": "Navy Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/navy-blue.png"
        },
        {
          "id": 10,
          "name": "owl_gray",
          "presentation": "Owl Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/owl-gray.png"
        },
        {
          "id": 11,
          "name": "rosa_red",
          "presentation": "Rosa Red",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/rosa-red.png"
        },
        {
          "id": 12,
          "name": "pearl_blue",
          "presentation": "Pearl Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/pearl-blue.png"
        },
        {
          "id": 13,
          "name": "warm_brown",
          "presentation": "Warm Brown",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/warm-brown.png"
        },
        {
          "id": 5,
          "name": "tiffany_blue",
          "presentation": "Tiffany Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/tiffany-blue.png"
        },
        {
          "id": 14,
          "name": "seal_gray",
          "presentation": "Seal Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/seal-gray.png"
        },
        {
          "id": 15,
          "name": "light_brown",
          "presentation": "Light Brown",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/light-brown.png"
        },
        {
          "id": 16,
          "name": "ludo_gray",
          "presentation": "Ludo Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/ludo-gray.png"
        },
        {
          "id": 17,
          "name": "med_blue",
          "presentation": "Med Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/med-blue.png"
        },
        {
          "id": 138,
          "name": "stone_gray",
          "presentation": "Stone Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/stone-gray.png"
        },
        {
          "id": 135,
          "name": "canary_yellow",
          "presentation": "Canary Yellow",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/canary-yellow.png"
        },
        {
          "id": 134,
          "name": "azure_blue",
          "presentation": "Azure Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/azure-blue.png"
        },
        {
          "id": 133,
          "name": "cobalt_blue",
          "presentation": "Cobalt Blue",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/cobalt-blue.png"
        },
        {
          "id": 132,
          "name": "dove_gray",
          "presentation": "Dove Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/dove-gray.png"
        },
        {
          "id": 131,
          "name": "fumo_gray",
          "presentation": "Fumo Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/fumo-gray.png"
        },
        {
          "id": 136,
          "name": "iron_gray",
          "presentation": "Iron Gray",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/iron-gray.png"
        },
        {
          "id": 137,
          "name": "parchment_beige",
          "presentation": "Parchment Beige",
          "image_url": "https://s3-ap-southeast-1.amazonaws.com/production-static-images/swatches/parchment-beige.png"
        }
      ]
    }
  ],
  "customizations": [
    [
      {
        "option_type_id": 1,
        "option_value_id": 136
      }
    ],
    [
      {
        "option_type_id": 1,
        "option_value_id": 137
      }
    ]
  ]
}

能否增加个可选功能, 来生成 init(from decoder: Decoder) throws 的实现

个别参数需要异常判断

required public init(from decoder: Decoder) throws {
        let map = try decoder.container(keyedBy: CodingKeys.self)
//        do{
//            self.message  = try map.decode(String.self, forKey: .message)
//        }catch {
//            self.message  = ""
//        }

        self.subject  = try map.decode(String.self, forKey: .subject)
        
        self.dateline  = try map.decode(String.self, forKey: .dateline)        
        self.tid  = try map.decode(String.self, forKey: .tid)
        self.uid  = try map.decode(String.self, forKey: .uid)
        self.applyid  = try map.decode(String.self, forKey: .applyid)
        self.verified  = try map.decode(String.self, forKey: .verified)
 }

Snake to Camel works in reverse

Briefly describe your problem when use Baby.

When Snake to Camel unchecked — swift code includes appropriate enums. When it checked — it removes it.

JSON String


这种嵌套的 JSON 无法生成正确的 Model 吗?

服务端返回的 JSON 如下:

{
  "code": 200,
  "msg": "ok",
  "data": {
    "list": [
      {
        "id": 1,
        "pid": 0,
        "code": 110000,
        "name": "北京市"
      },
      {
        "id": 8040,
        "pid": 5630,
        "code": 1093,
        "name": "崖城镇"
      },
      {
        "id": 8041,
        "pid": 5630,
        "code": 1094,
        "name": "育才镇"
      },
      {
        "id": 8064,
        "pid": 8050,
        "code": 1117,
        "name": "陵水黎族自治县"
      },
      {
        "id": 8065,
        "pid": 8050,
        "code": 1118,
        "name": "保亭黎族苗族自治县"
      },
      {
        "id": 8066,
        "pid": 8050,
        "code": 1119,
        "name": "琼中黎族苗族自治县"
      },
      {
        "id": 8067,
        "pid": 5939,
        "code": 1120,
        "name": "经开区"
      },
      {
        "id": 8081,
        "pid": 8077,
        "code": 1134,
        "name": "五家渠市"
      }
    ]
  }
}

错误如下:
图片

某些字符串值被错误的映射为 URL

Briefly describe your problem when use Baby.

其中 content_id, img_width, label_title 等值,被转化为 URL。以下是转换的 JSON 和转换后的 Swift 结果。

JSON String

{
  "ret": 200,
  "result": {
    "code": "1",
    "msg": "获取内容成功",
    "info": [
      {
        "content_id": "174",
        "content_title": "",
        "content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/29c015a4569845bcae1529fe69f5b62b.jpg",
        "content_smallImgSrc": "",
        "img_width": "4000",
        "img_height": "2667",
        "imageAve": "0x6e5f56",
        "labels": [
          {
            "label_id": "126",
            "label_title": "Angelica",
            "label_likeNum": "0"
          },
          {
            "label_id": "127",
            "label_title": "AV",
            "label_likeNum": "0"
          },
          {
            "label_id": "128",
            "label_title": "Russia",
            "label_likeNum": "0"
          },
          {
            "label_id": "129",
            "label_title": "Sexy",
            "label_likeNum": "0"
          }
        ]
      },
      {
        "content_id": "173",
        "content_title": "",
        "content_imgsrc": "http://oq8t6idvw.bkt.clouddn.com/b065883925a84a15aa2d7efbeb4fdf2e.jpg",
        "content_smallImgSrc": "",
        "img_width": "4000",
        "img_height": "2667",
        "imageAve": "0x70645b",
        "labels": [
          {
            "label_id": "126",
            "label_title": "Angelica",
            "label_likeNum": "0"
          },
          {
            "label_id": "127",
            "label_title": "AV",
            "label_likeNum": "0"
          },
          {
            "label_id": "128",
            "label_title": "Russia",
            "label_likeNum": "0"
          },
          {
            "label_id": "129",
            "label_title": "Sexy",
            "label_likeNum": "0"
          }
        ]
      }
    ],
    "pageModel": {
      "page": "1",
      "pagesize": "2"
    }
  },
  "msg": ""
}

结果

struct ItemModel {
    let msg: String
    let ret: Int
    struct Result {
        let msg: String
        let code: URL
        struct Item {
            let contentSmallImgSrc: String
            struct Label {
                let labelId: URL
                let labelTitle: URL
                let labelLikeNum: URL
                init(labelId: URL, labelTitle: URL, labelLikeNum: URL) {
                    self.labelId = labelId
                    self.labelTitle = labelTitle
                    self.labelLikeNum = labelLikeNum
                }
                init?(json: [String: Any]) {
                    guard let labelIdString = json["label_id"] as? String else { return nil }
                    guard let labelId = URL(string: labelIdString) else { return nil }
                    guard let labelTitleString = json["label_title"] as? String else { return nil }
                    guard let labelTitle = URL(string: labelTitleString) else { return nil }
                    guard let labelLikeNumString = json["label_likeNum"] as? String else { return nil }
                    guard let labelLikeNum = URL(string: labelLikeNumString) else { return nil }
                    self.init(labelId: labelId, labelTitle: labelTitle, labelLikeNum: labelLikeNum)
                }
            }
            let labels: [Label]
            let imgWidth: URL
            let imgHeight: URL
            let imageAve: URL
            let contentTitle: String
            let contentId: URL
            let contentImgsrc: URL
            init(contentSmallImgSrc: String, labels: [Label], imgWidth: URL, imgHeight: URL, imageAve: URL, contentTitle: String, contentId: URL, contentImgsrc: URL) {
                self.contentSmallImgSrc = contentSmallImgSrc
                self.labels = labels
                self.imgWidth = imgWidth
                self.imgHeight = imgHeight
                self.imageAve = imageAve
                self.contentTitle = contentTitle
                self.contentId = contentId
                self.contentImgsrc = contentImgsrc
            }
            init?(json: [String: Any]) {
                guard let contentSmallImgSrc = json["content_smallImgSrc"] as? String else { return nil }
                guard let labelsJSONArray = json["labels"] as? [[String: Any]] else { return nil }
                let labels = labelsJSONArray.map({ Label(json: $0) }).flatMap({ $0 })
                guard let imgWidthString = json["img_width"] as? String else { return nil }
                guard let imgWidth = URL(string: imgWidthString) else { return nil }
                guard let imgHeightString = json["img_height"] as? String else { return nil }
                guard let imgHeight = URL(string: imgHeightString) else { return nil }
                guard let imageAveString = json["imageAve"] as? String else { return nil }
                guard let imageAve = URL(string: imageAveString) else { return nil }
                guard let contentTitle = json["content_title"] as? String else { return nil }
                guard let contentIdString = json["content_id"] as? String else { return nil }
                guard let contentId = URL(string: contentIdString) else { return nil }
                guard let contentImgsrcString = json["content_imgsrc"] as? String else { return nil }
                guard let contentImgsrc = URL(string: contentImgsrcString) else { return nil }
                self.init(contentSmallImgSrc: contentSmallImgSrc, labels: labels, imgWidth: imgWidth, imgHeight: imgHeight, imageAve: imageAve, contentTitle: contentTitle, contentId: contentId, contentImgsrc: contentImgsrc)
            }
        }
        let items: [Item]
        struct PageModel {
            let pagesize: URL
            let page: URL
            init(pagesize: URL, page: URL) {
                self.pagesize = pagesize
                self.page = page
            }
            init?(json: [String: Any]) {
                guard let pagesizeString = json["pagesize"] as? String else { return nil }
                guard let pagesize = URL(string: pagesizeString) else { return nil }
                guard let pageString = json["page"] as? String else { return nil }
                guard let page = URL(string: pageString) else { return nil }
                self.init(pagesize: pagesize, page: page)
            }
        }
        let pageModel: PageModel
        init(msg: String, code: URL, items: [Item], pageModel: PageModel) {
            self.msg = msg
            self.code = code
            self.items = items
            self.pageModel = pageModel
        }
        init?(json: [String: Any]) {
            guard let msg = json["msg"] as? String else { return nil }
            guard let codeString = json["code"] as? String else { return nil }
            guard let code = URL(string: codeString) else { return nil }
            guard let itemsJSONArray = json["info"] as? [[String: Any]] else { return nil }
            let items = itemsJSONArray.map({ Item(json: $0) }).flatMap({ $0 })
            guard let pageModelJSONDictionary = json["pageModel"] as? [String: Any] else { return nil }
            guard let pageModel = PageModel(json: pageModelJSONDictionary) else { return nil }
            self.init(msg: msg, code: code, items: items, pageModel: pageModel)
        }
    }
    let result: Result
    init(msg: String, ret: Int, result: Result) {
        self.msg = msg
        self.ret = ret
        self.result = result
    }
    init?(json: [String: Any]) {
        guard let msg = json["msg"] as? String else { return nil }
        guard let ret = json["ret"] as? Int else { return nil }
        guard let resultJSONDictionary = json["result"] as? [String: Any] else { return nil }
        guard let result = Result(json: resultJSONDictionary) else { return nil }
        self.init(msg: msg, ret: ret, result: result)
    }
}

not conforming to protocol

I am getting the error that the struct does not conform to protocol encodable or decodable.

JSON String
{"dataset":{"id":19704762,"dataset_code":"AB_AL","database_code":"LME","name":"Aluminium Asian Benchmark Prices","description":"LME Asian Benchmark Prices in US$ per tonne","refreshed_at":"2017-09-26T07:05:23.154Z","newest_available_date":"2017-09-25","oldest_available_date":"2015-02-11","column_names":["Date","Value"],"frequency":"daily","type":"Time Series","premium":false,"limit":null,"transform":null,"column_index":null,"start_date":"2015-02-11","end_date":"2017-09-25","data":[["2017-09-25",2141.67],["2017-09-22",2125.81],["2017-09-21",2160.63],["2017-09-20",2171.34],["2017-09-19",2101.15],["2017-09-18",2091.99],["2017-09-15",2090.37],["2017-09-14",2112.07],["2017-09-13",2133.04],["2017-09-12",2124.1],["2017-09-11",2126.71],["2017-09-08",2089.82],["2017-09-07",2090.77],["2017-09-06",2089.18],["2017-09-05",2110.8],["2017-09-04",2125.09],["2017-09-01",2139.74],["2017-08-31",2099.0],["2017-08-30",2101.03],["2017-08-29",2072.67],["2017-08-25",2110.29],["2017-08-24",2093.03],["2017-08-23",2069.82],["2017-08-22",2077.6],["2017-08-21",2081.47],["2017-08-18",2080.84],["2017-08-17",2109.43],["2017-08-16",2060.48],["2017-08-15",2035.97],["2017-08-14",2027.01],["2017-08-11",2035.98],["2017-08-10",2035.98],["2017-08-09",2035.98],["2017-08-08",1974.21],["2017-08-07",1924.33],["2017-08-04",1909.82],["2017-08-03",1920.5],["2017-08-02",1926.72],["2017-08-01",1913.12],["2017-07-31",1919.9],["2017-07-28",1936.36],["2017-07-27",1932.76],["2017-07-26",1943.34],["2017-07-25",1923.74],["2017-07-24",1920.46],["2017-07-21",1926.29],["2017-07-20",1924.4],["2017-07-19",1904.78],["2017-07-18",1904.78],["2017-07-17",1935.98],["2017-07-14",1928.5],["2017-07-13",1899.55],["2017-07-12",1899.84],["2017-07-11",1904.36],["2017-07-10",1921.68],["2017-07-07",1939.25],["2017-07-06",1929.09],["2017-07-05",1929.4],["2017-07-04",1924.41],["2017-07-03",1928.84],["2017-06-30",1913.36],["2017-06-29",1904.59],["2017-06-28",1890.93],["2017-06-27",1871.19],["2017-06-26",1874.45],["2017-06-23",1875.99],["2017-06-22",1868.64],["2017-06-21",1880.25],["2017-06-20",1899.69],["2017-06-19",1884.94],["2017-06-16",1874.42],["2017-06-15",1882.92],["2017-06-14",1890.37],["2017-06-13",1888.32],["2017-06-12",1899.98],["2017-06-09",1889.95],["2017-06-08",1915.22],["2017-06-07",1900.65],["2017-06-06",1897.7],["2017-06-05",1927.01],["2017-06-02",1930.62],["2017-06-01",1928.57],["2017-05-31",1915.56],["2017-05-30",1947.42],["2017-05-26",1963.93],["2017-05-25",1954.11],["2017-05-24",1935.67],["2017-05-23",1922.99],["2017-05-22",1936.54],["2017-05-19",1914.78],["2017-05-18",1906.34],["2017-05-17",1921.49],["2017-05-16",1902.27],["2017-05-15",1897.09],["2017-05-12",1880.79],["2017-05-11",1873.96],["2017-05-10",1868.59],["2017-05-09",1874.51],["2017-05-08",1890.17],["2017-05-05",1911.13],["2017-05-04",1913.4],["2017-05-03",1918.44],["2017-05-02",1905.14],["2017-04-28",1920.8],["2017-04-27",1965.42],["2017-04-26",1957.14],["2017-04-25",1950.17],["2017-04-24",1944.05],["2017-04-21",1953.76],["2017-04-20",1927.85],["2017-04-19",1903.92],["2017-04-18",1942.42],["2017-04-13",1915.0],["2017-04-12",1916.06],["2017-04-11",1919.67],["2017-04-10",1950.2],["2017-04-07",1947.25],["2017-04-06",1963.33],["2017-04-05",1961.08],["2017-04-04",1947.01],["2017-04-03",1970.47],["2017-03-31",1970.65],["2017-03-30",1956.79],["2017-03-29",1949.4],["2017-03-28",1923.51],["2017-03-27",1928.32],["2017-03-24",1927.1],["2017-03-23",1924.67],["2017-03-22",1925.91],["2017-03-21",1915.62],["2017-03-20",1906.33],["2017-03-17",1892.0],["2017-03-16",1901.13],["2017-03-15",1869.68],["2017-03-14",1869.55],["2017-03-13",1890.52],["2017-03-10",1885.2],["2017-03-09",1866.68],["2017-03-08",1877.28],["2017-03-07",1871.9],["2017-03-06",1876.33],["2017-03-03",1919.35],["2017-03-02",1937.62],["2017-03-01",1927.21],["2017-02-28",1895.09],["2017-02-27",1880.53],["2017-02-24",1870.68],["2017-02-23",1873.37],["2017-02-22",1871.81],["2017-02-21",1891.0],["2017-02-20",1889.16],["2017-02-17",1882.76],["2017-02-16",1903.22],["2017-02-15",1894.18],["2017-02-14",1894.32],["2017-02-13",1880.0],["2017-02-10",1849.85],["2017-02-09",1844.05],["2017-02-08",1836.4],["2017-02-07",1831.89],["2017-02-06",1824.26],["2017-02-03",1824.34],["2017-02-02",1823.25],["2017-02-01",1826.05],["2017-01-31",1804.5],["2017-01-30",1822.33],["2017-01-27",1822.83],["2017-01-26",1848.08],["2017-01-25",1871.44],["2017-01-24",1848.37],["2017-01-23",1854.5],["2017-01-20",1814.74],["2017-01-19",1815.48],["2017-01-18",1797.17],["2017-01-17",1778.1],["2017-01-16",1805.95],["2017-01-13",1789.41],["2017-01-12",1764.93],["2017-01-11",1753.03],["2017-01-10",1728.08],["2017-01-09",1711.79],["2017-01-06",1694.81],["2017-01-05",1695.79],["2017-01-04",1689.5],["2017-01-03",1701.0],["2016-12-30",1695.27],["2016-12-29",1705.61],["2016-12-28",1725.05],["2016-12-23",1718.62],["2016-12-22",1720.86],["2016-12-21",1724.37],["2016-12-20",1708.12],["2016-12-19",1710.57],["2016-12-16",1733.0],["2016-12-15",1743.0],["2016-12-14",1734.56],["2016-12-12",1755.4],["2016-12-09",1740.12],["2016-12-08",1716.36],["2016-12-07",1713.98],["2016-12-06",1720.12],["2016-12-05",1718.75],["2016-12-02",1717.0],["2016-12-01",1737.96],["2016-11-30",1711.6],["2016-11-29",1728.79],["2016-11-28",1778.31],["2016-11-25",1754.93],["2016-11-24",1777.0],["2016-11-23",1754.08],["2016-11-22",1733.2],["2016-11-21",1712.87],["2016-11-18",1689.5],["2016-11-17",1694.82],["2016-11-16",1716.98],["2016-11-15",1718.07],["2016-11-14",1768.01],["2016-11-11",1770.0],["2016-11-10",1759.97],["2016-11-09",1712.12],["2016-11-08",1723.0],["2016-11-07",1724.3],["2016-11-04",1720.29],["2016-11-03",1719.5],["2016-11-02",1700.0],["2016-11-01",1734.99],["2016-10-31",1715.56],["2016-10-28",1697.96],["2016-10-27",1675.23],["2016-10-26",1673.66],["2016-10-25",1659.24],["2016-10-24",1635.93],["2016-10-21",1621.5],["2016-10-20",1624.26],["2016-10-19",1631.96],["2016-10-18",1677.07],["2016-10-17",1669.31],["2016-10-14",1692.52],["2016-10-13",1679.33],["2016-10-12",1674.83],["2016-10-11",1691.94],["2016-10-10",1682.83],["2016-10-07",1677.99],["2016-10-06",1665.16],["2016-10-05",1664.11],["2016-10-04",1669.53],["2016-10-03",1676.51],["2016-09-30",1662.67],["2016-09-29",1665.16],["2016-09-28",1654.56],["2016-09-27",1660.38],["2016-09-26",1632.62],["2016-09-23",1646.26],["2016-09-22",1602.4],["2016-09-21",1577.09],["2016-09-20",1587.27],["2016-09-19",1573.48],["2016-09-16",1579.48],["2016-09-15",1591.82],["2016-09-14",1565.03],["2016-09-13",1570.24],["2016-09-12",1567.56],["2016-09-09",1588.42],["2016-09-08",1587.41],["2016-09-07",1591.35],["2016-09-06",1590.27],["2016-09-05",1591.92],["2016-09-02",1613.4],["2016-09-01",1621.67],["2016-08-31",1627.02],["2016-08-30",1637.03],["2016-08-26",1650.88],["2016-08-25",1649.59],["2016-08-24",1667.0],["2016-08-23",1667.15],["2016-08-22",1655.74],["2016-08-19",1683.11],["2016-08-18",1700.34],["2016-08-17",1687.11],["2016-08-16",1676.84],["2016-08-15",1652.41],["2016-08-12",1648.2],["2016-08-11",1646.31],["2016-08-10",1653.13],["2016-08-09",1636.05],["2016-08-08",1652.73],["2016-08-05",1636.33],["2016-08-04",1637.0],["2016-08-03",1617.77],["2016-08-02",1638.14],["2016-08-01",1651.35],["2016-07-29",1607.16],["2016-07-28",1601.87],["2016-07-27",1593.8],["2016-07-26",1607.77],["2016-07-25",1616.23],["2016-07-22",1601.29],["2016-07-21",1630.39],["2016-07-20",1644.12],["2016-07-19",1657.5],["2016-07-18",1661.06],["2016-07-15",1680.81],["2016-07-14",1681.7],["2016-07-13",1681.12],["2016-07-12",1652.06],["2016-07-11",1668.26],["2016-07-08",1649.11],["2016-07-07",1654.97],["2016-07-06",1658.17],["2016-07-05",1644.34],["2016-07-04",1665.27],["2016-07-01",1660.22],["2016-06-30",1634.63],["2016-06-29",1626.11],["2016-06-28",1609.0],["2016-06-27",1611.08],["2016-06-24",1600.48],["2016-06-23",1631.43],["2016-06-22",1634.84],["2016-06-21",1637.46],["2016-06-20",1620.89],["2016-06-17",1621.76],["2016-06-16",1611.83],["2016-06-15",1609.23],["2016-06-14",1596.78],["2016-06-13",1566.14],["2016-06-10",1577.86],["2016-06-09",1619.41],["2016-06-08",1573.71],["2016-06-07",1548.0],["2016-06-06",1542.29],["2016-06-03",1546.77],["2016-06-02",1573.53],["2016-06-01",1548.53],["2016-05-31",1550.74],["2016-05-27",1559.5],["2016-05-26",1554.64],["2016-05-25",1544.11],["2016-05-24",1546.16],["2016-05-23",1535.69],["2016-05-20",1554.36],["2016-05-19",1544.35],["2016-05-18",1536.63],["2016-05-17",1562.22],["2016-05-16",1544.68],["2016-05-13",1545.5],["2016-05-12",1570.2],["2016-05-11",1571.0],["2016-05-10",1559.96],["2016-05-09",1579.05],["2016-05-06",1607.44],["2016-05-05",1633.75],["2016-05-04",1630.32],["2016-05-03",1682.83],["2016-04-29",1665.5],["2016-04-28",1634.5],["2016-04-27",1635.97],["2016-04-26",1642.55],["2016-04-25",1653.01],["2016-04-22",1640.22],["2016-04-21",1632.61],["2016-04-20",1584.95],["2016-04-19",1575.17],["2016-04-18",1545.33],["2016-04-15",1554.32],["2016-04-14",1547.93],["2016-04-13",1535.25],["2016-04-12",1502.36],["2016-04-11",1512.17],["2016-04-08",1498.75],["2016-04-07",1513.65],["2016-04-06",1511.13],["2016-04-05",1536.65],["2016-04-04",1530.65],["2016-04-01",1527.13],["2016-03-31",1495.02],["2016-03-30",1491.48],["2016-03-29",1482.85],["2016-03-24",1486.0],["2016-03-23",1495.0],["2016-03-22",1513.5],["2016-03-21",1520.5],["2016-03-18",1537.7],["2016-03-17",1526.0],["2016-03-16",1520.0],["2016-03-15",1543.09],["2016-03-14",1561.12],["2016-03-11",1570.5],["2016-03-10",1573.08],["2016-03-09",1567.0],["2016-03-08",1592.5],["2016-03-07",1579.87],["2016-03-04",1587.0],["2016-03-03",1591.0],["2016-03-02",1586.0],["2016-03-01",1569.0],["2016-02-29",1569.0],["2016-02-26",1570.5],["2016-02-25",1566.0],["2016-02-24",1546.0],["2016-02-23",1577.07],["2016-02-22",1551.0],["2016-02-19",1531.5],["2016-02-18",1525.03],["2016-02-17",1520.5],["2016-02-16",1525.04],["2016-02-15",1520.32],["2016-02-12",1492.5],["2016-02-11",1493.23],["2016-02-10",1487.0],["2016-02-09",1510.5],["2016-02-08",1504.5],["2016-02-05",1531.5],["2016-02-04",1536.0],["2016-02-03",1509.56],["2016-02-02",1516.97],["2016-02-01",1513.0],["2016-01-29",1518.12],["2016-01-28",1516.56],["2016-01-27",1507.5],["2016-01-26",1476.5],["2016-01-25",1478.0],["2016-01-22",1481.93],["2016-01-21",1466.5],["2016-01-20",1474.09],["2016-01-19",1496.9],["2016-01-18",1474.5],["2016-01-15",1468.5],["2016-01-14",1466.5],["2016-01-13",1462.0],["2016-01-12",1454.8],["2016-01-11",1477.08],["2016-01-08",1475.49],["2016-01-07",1462.5],["2016-01-06",1465.0],["2016-01-05",1497.0],["2016-01-04",1465.0],["2015-12-31",1506.5],["2015-12-30",1529.5],["2015-12-29",1521.02],["2015-12-24",1539.25],["2015-12-23",1523.77],["2015-12-22",1513.85],["2015-12-21",1520.0],["2015-12-18",1485.0],["2015-12-17",1484.0],["2015-12-16",1477.0],["2015-12-15",1481.5],["2015-12-14",1489.29],["2015-12-11",1505.0],["2015-12-10",1480.2],["2015-12-09",1490.42],["2015-12-08",1488.5],["2015-12-07",1508.0],["2015-12-04",1483.0],["2015-12-03",1472.0],["2015-12-02",1467.15],["2015-12-01",1457.15],["2015-11-30",1456.5],["2015-11-27",1499.99],["2015-11-26",1482.45],["2015-11-25",1453.55],["2015-11-24",1457.24],["2015-11-23",1443.12],["2015-11-20",1470.96],["2015-11-19",1464.71],["2015-11-18",1474.5],["2015-11-17",1466.48],["2015-11-16",1476.94],["2015-11-13",1497.15],["2015-11-12",1519.0],["2015-11-11",1489.64],["2015-11-10",1499.48],["2015-11-09",1516.4],["2015-11-06",1506.0],["2015-11-05",1495.56],["2015-11-04",1509.43],["2015-11-03",1506.25],["2015-11-02",1477.5],["2015-10-30",1475.5],["2015-10-29",1473.0],["2015-10-28",1468.15],["2015-10-27",1489.98],["2015-10-26",1498.5],["2015-10-23",1497.39],["2015-10-22",1513.0],["2015-10-21",1522.9],["2015-10-20",1536.97],["2015-10-19",1555.53],["2015-10-16",1565.71],["2015-10-15",1591.0],["2015-10-14",1587.5],["2015-10-13",1586.1],["2015-10-12",1627.92],["2015-10-09",1606.74],["2015-10-08",1568.05],["2015-10-07",1566.0],["2015-10-06",1557.5],["2015-10-05",1568.96],["2015-10-02",1566.67],["2015-10-01",1583.42],["2015-09-30",1577.9],["2015-09-29",1543.31],["2015-09-28",1565.77],["2015-09-25",1580.41],["2015-09-24",1583.25],["2015-09-23",1583.72],["2015-09-22",1607.96],["2015-09-21",1614.5],["2015-09-18",1624.89],["2015-09-17",1628.47],["2015-09-16",1621.13],["2015-09-15",1602.42],["2015-09-14",1627.17],["2015-09-11",1641.0],["2015-09-10",1630.2],["2015-09-09",1645.48],["2015-09-08",1603.0],["2015-09-07",1619.97],["2015-09-04",1630.25],["2015-09-03",1607.1],["2015-09-02",1600.29],["2015-09-01",1586.01],["2015-08-28",1567.55],["2015-08-27",1550.51],["2015-08-26",1542.9],["2015-08-25",1530.07],["2015-08-24",1527.03],["2015-08-21",1563.5],["2015-08-20",1561.06],["2015-08-19",1554.17],["2015-08-18",1562.24],["2015-08-17",1578.68],["2015-08-14",1569.94],["2015-08-13",1590.66],["2015-08-12",1559.82],["2015-08-11",1588.04],["2015-08-10",1590.12],["2015-08-07",1586.7],["2015-08-06",1593.54],["2015-08-05",1615.5],["2015-08-04",1615.5],["2015-08-03",1608.3],["2015-07-31",1635.36],["2015-07-30",1657.54],["2015-07-29",1665.67],["2015-07-28",1650.27],["2015-07-27",1635.05],["2015-07-24",1633.78],["2015-07-23",1661.73],["2015-07-22",1656.96],["2015-07-21",1685.71],["2015-07-20",1696.99],["2015-07-17",1715.0],["2015-07-16",1720.56],["2015-07-15",1716.93],["2015-07-14",1702.87],["2015-07-13",1695.57],["2015-07-10",1695.08],["2015-07-09",1681.61],["2015-07-08",1640.29],["2015-07-07",1689.04],["2015-07-06",1695.08],["2015-07-03",1724.97],["2015-07-02",1729.05],["2015-07-01",1685.15],["2015-06-30",1688.36],["2015-06-29",1703.71],["2015-06-26",1724.13],["2015-06-25",1712.65],["2015-06-24",1733.0],["2015-06-23",1719.51],["2015-06-22",1693.84],["2015-06-19",1700.29],["2015-06-17",1700.74],["2015-06-16",1716.28],["2015-06-09",1750.64],["2015-06-08",1747.71],["2015-06-05",1737.17],["2015-06-03",1741.5],["2015-06-02",1764.56],["2015-06-01",1751.67],["2015-05-29",1779.15],["2015-05-28",1747.85],["2015-05-27",1757.04],["2015-05-26",1771.19],["2015-05-22",1773.67],["2015-05-21",1786.42],["2015-05-20",1791.93],["2015-05-19",1815.18],["2015-05-18",1859.99],["2015-05-15",1871.8],["2015-05-14",1893.62],["2015-05-13",1904.22],["2015-05-12",1877.26],["2015-05-07",1894.93],["2015-05-06",1968.9],["2015-05-05",1903.96],["2015-05-01",1929.95],["2015-04-30",1886.36],["2015-04-29",1872.04],["2015-04-28",1842.62],["2015-04-27",1828.09],["2015-04-24",1785.02],["2015-04-23",1794.25],["2015-04-22",1820.5],["2015-04-21",1811.3],["2015-04-20",1834.26],["2015-04-17",1823.49],["2015-04-16",1827.38],["2015-04-15",1800.45],["2015-04-14",1762.5],["2015-04-13",1765.96],["2015-04-10",1769.49],["2015-04-09",1771.66],["2015-04-08",1784.82],["2015-04-07",1782.5],["2015-04-02",1782.32],["2015-04-01",1789.78],["2015-03-31",1790.66],["2015-03-30",1783.12],["2015-03-27",1787.0],["2015-03-26",1780.5],["2015-03-25",1786.79],["2015-03-24",1794.37],["2015-03-23",1800.0],["2015-03-20",1780.04],["2015-03-19",1778.69],["2015-03-18",1781.37],["2015-03-17",1776.5],["2015-03-16",1781.0],["2015-03-13",1761.81],["2015-03-12",1764.74],["2015-03-11",1764.02],["2015-03-10",1780.5],["2015-03-09",1785.81],["2015-03-06",1799.77],["2015-03-05",1797.5],["2015-03-04",1797.5],["2015-03-03",1801.45],["2015-03-02",1828.0],["2015-02-27",1808.0],["2015-02-26",1806.11],["2015-02-25",1818.5],["2015-02-24",1795.0],["2015-02-23",1808.5],["2015-02-20",1818.5],["2015-02-19",1821.5],["2015-02-18",1819.5],["2015-02-17",1829.0],["2015-02-16",1843.04],["2015-02-13",1850.25],["2015-02-12",1827.0],["2015-02-11",1836.86]],"collapse":null,"order":null,"database_id":13206}}

Struct created
struct Aluminum: Codable {
    struct Dataset: Codable {
        let id: Int
        let datasetCode: String
        let databaseCode: String
        let name: String
        let description: String
        let refreshedAt: Date
        let newestAvailableDate: Date
        let oldestAvailableDate: Date
        let columnNames: [String]
        let frequency: String
        let type: String
        let premium: Bool
        let limit: Any?
        let transform: Any?
        let columnIndex: Any?
        let startDate: Date
        let endDate: Date
        let data: [[Any]]
        let collapse: Any?
        let order: Any?
        let databaseId: Int
        private enum CodingKeys: String, CodingKey {
            case id
            case datasetCode = "dataset_code"
            case databaseCode = "database_code"
            case name
            case description
            case refreshedAt = "refreshed_at"
            case newestAvailableDate = "newest_available_date"
            case oldestAvailableDate = "oldest_available_date"
            case columnNames = "column_names"
            case frequency
            case type
            case premium
            case limit
            case transform
            case columnIndex = "column_index"
            case startDate = "start_date"
            case endDate = "end_date"
            case data
            case collapse
            case order
            case databaseId = "database_id"
        }
    }
    let dataset: Dataset
}

<img width="876" alt="screenshot 2017-09-27 13 08 57" src="https://user-images.githubusercontent.com/10660317/30927009-0e83073c-a385-11e7-9747-5ac352677f48.png">


Realm support

I'd love to be able to generate Realm object models w/ Baby!

Format button fails.

Briefly describe your problem when use Baby.

Format button make JSON invalid.

JSON String

{
  "suggestions": [
    {
      "value": "ООО \"ГЕЙТВЕЙ\"",
      "unrestricted_value": "ООО \"ГЕЙТВЕЙ\"",
      "data": {
        "kpp": "773401001",
        "capital": null,
        "management": {
          "name": "Лащевкер Олег Дмитриевич",
          "post": "ГЕНЕРАЛЬНЫЙ ДИРЕКТОР"
        },
        "founders": null,
        "managers": null,
        "branch_type": "MAIN",
        "branch_count": 0,
        "source": null,
        "qc": null,
        "hid": "26ef93fc1581f1e38913dca6e8b2572ad6788da0c5043b9b9b1ff183d6e4a73e",
        "type": "LEGAL",
        "state": {
          "status": "ACTIVE",
          "actuality_date": 1546300800000,
          "registration_date": 905990400000,
          "liquidation_date": null
        },
        "opf": {
          "type": "2014",
          "code": "12300",
          "full": "Общество с ограниченной ответственностью",
          "short": "ООО"
        },
        "name": {
          "full_with_opf": "ОБЩЕСТВО С ОГРАНИЧЕННОЙ ОТВЕТСТВЕННОСТЬЮ \"ГЕЙТВЕЙ\"",
          "short_with_opf": "ООО \"ГЕЙТВЕЙ\"",
          "latin": null,
          "full": "ГЕЙТВЕЙ",
          "short": "ГЕЙТВЕЙ"
        },
        "inn": "7734187531",
        "ogrn": "1027739512954",
        "okpo": null,
        "okved": "52.29",
        "okveds": null,
        "authorities": null,
        "documents": null,
        "licenses": null,
        "address": {
          "value": "г Москва, ул Расплетина, д 24",
          "unrestricted_value": "г Москва, р-н Щукино, ул Расплетина, д 24",
          "data": {
            "postal_code": "123060",
            "country": "Россия",
            "region_fias_id": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
            "region_kladr_id": "7700000000000",
            "region_with_type": "г Москва",
            "region_type": "г",
            "region_type_full": "город",
            "region": "Москва",
            "area_fias_id": null,
            "area_kladr_id": null,
            "area_with_type": null,
            "area_type": null,
            "area_type_full": null,
            "area": null,
            "city_fias_id": "0c5b2444-70a0-4932-980c-b4dc0d3f02b5",
            "city_kladr_id": "7700000000000",
            "city_with_type": "г Москва",
            "city_type": "г",
            "city_type_full": "город",
            "city": "Москва",
            "city_area": "Северо-западный",
            "city_district_fias_id": null,
            "city_district_kladr_id": null,
            "city_district_with_type": "р-н Щукино",
            "city_district_type": "р-н",
            "city_district_type_full": "район",
            "city_district": "Щукино",
            "settlement_fias_id": null,
            "settlement_kladr_id": null,
            "settlement_with_type": null,
            "settlement_type": null,
            "settlement_type_full": null,
            "settlement": null,
            "street_fias_id": "77c863ef-4699-44c2-accd-440d0051b68e",
            "street_kladr_id": "77000000000245200",
            "street_with_type": "ул Расплетина",
            "street_type": "ул",
            "street_type_full": "улица",
            "street": "Расплетина",
            "house_fias_id": "6ded6c26-cc50-479e-8f9a-92f845179f1b",
            "house_kladr_id": "7700000000024520066",
            "house_type": "д",
            "house_type_full": "дом",
            "house": "24",
            "block_type": null,
            "block_type_full": null,
            "block": null,
            "flat_type": null,
            "flat_type_full": null,
            "flat": null,
            "flat_area": null,
            "square_meter_price": null,
            "flat_price": null,
            "postal_box": null,
            "fias_id": "6ded6c26-cc50-479e-8f9a-92f845179f1b",
            "fias_code": "77000000000000024520066",
            "fias_level": "8",
            "fias_actuality_state": "0",
            "kladr_id": "7700000000024520066",
            "geoname_id": null,
            "capital_marker": "0",
            "okato": "45283587000",
            "oktmo": "45372000",
            "tax_office": "7734",
            "tax_office_legal": "7734",
            "timezone": "UTC+3",
            "geo_lat": "55.7944205",
            "geo_lon": "37.4843382",
            "beltway_hit": "IN_MKAD",
            "beltway_distance": null,
            "metro": [
              {
                "name": "Октябрьское поле",
                "line": "Таганско-Краснопресненская",
                "distance": 0.6
              },
              {
                "name": "Панфиловская",
                "line": "МЦК",
                "distance": 1.1
              },
              {
                "name": "Зорге",
                "line": "МЦК",
                "distance": 1.5
              }
            ],
            "qc_geo": "0",
            "qc_complete": null,
            "qc_house": null,
            "history_values": null,
            "unparsed_parts": null,
            "source": "123060, ГОРОД МОСКВА, УЛИЦА РАСПЛЕТИНА, 24",
            "qc": "0"
          }
        },
        "phones": null,
        "emails": null,
        "ogrn_date": 1036540800000,
        "okved_type": "2014"
      }
    }
  ]
}

Hmmm. What should these do...

Given the following JSON...

{
  "code" : "SUCCESS",
  "positions" : [ {
    "asOf" : "2018-03-30T04:00:00.000Z",
    "description" : "***Euro ",
    "shortName" : "CASH - EURO",
    "tradeActions" : [ ]
  } ]
}

Codable conversion

The default Codable conversion for this using command line baby is...

struct MyModel: Codable {
    let code: String
    struct Position: Codable {
        let asOf: Date
        let description: String
        let shortName: String
        let tradeActions: [Any] //TODO: Specify the type to conforms Codable protocol
    }
    let positions: [Position]
}

array-object-map and enum-properties issues

My question revolves around the TODO. In this case, the values of the tradeActions array are items from an enumerated set, TradeAction. The TradeAction enum has members like "SELL" and "BUY".

The baby help seems to indicate that I can specify the type of the tradeActions array, and also declare the TradeAction enum.

So here's the baby command line I used...

baby -i t01short.json --codable --model-type struct --model-name DWMPositionsModel --json-dictionary-name "[String: Any]" --convert-from-snake-case --array-object-map "tradeActions: [TradeAction]" --enum-properties "type, TradeAction[BUY_MORE, BUY_TO_CLOSE]"

My expectation is that I would receive something similar to the following...

struct MyModel: Codable {
    let code: String
    struct Position: Codable {
        let asOf: Date
        let description: String
        let shortName: String
        let tradeActions: [TradeAction]
    }
    let positions: [Position]
    enum TradeAction {
        case BUY_MORE
        case BUY_TO_CLOSE
    }
}

However, the output is identical to the initial Codable conversion.

The array-object-map and enum-properties don't appear to actually do anything. Or am I not using them right? I see the same behavior when using CuteBaby.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.