{"action":"created","issue":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/3014","labels_url":"https://api.github.com/repos/hashicorp/terraform/issues/3014/labels{/name}","comments_url":"https://api.github.com/repos/hashicorp/terraform/issues/3014/comments","events_url":"https://api.github.com/repos/hashicorp/terraform/issues/3014/events","html_url":"https://github.com/hashicorp/terraform/issues/3014","id":101475647,"number":3014,"title":"[proposal] Introduce Schema.TypeJSON?","user":{"login":"radeksimko","id":287584,"avatar_url":"https://avatars.githubusercontent.com/u/287584?v=3","gravatar_id":"","url":"https://api.github.com/users/radeksimko","html_url":"https://github.com/radeksimko","followers_url":"https://api.github.com/users/radeksimko/followers","following_url":"https://api.github.com/users/radeksimko/following{/other_user}","gists_url":"https://api.github.com/users/radeksimko/gists{/gist_id}","starred_url":"https://api.github.com/users/radeksimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radeksimko/subscriptions","organizations_url":"https://api.github.com/users/radeksimko/orgs","repos_url":"https://api.github.com/users/radeksimko/repos","events_url":"https://api.github.com/users/radeksimko/events{/privacy}","received_events_url":"https://api.github.com/users/radeksimko/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hashicorp/terraform/labels/core","name":"core","color":"cccccc"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/enhancement","name":"enhancement","color":"d4c5f9"},{"url":"https://api.github.com/repos/hashicorp/terraform/labels/proposal","name":"proposal","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-08-17T17:56:11Z","updated_at":"2015-08-19T06:17:55Z","closed_at":null,"body":"In the face of https://github.com/hashicorp/terraform/issues/2589 and similar issues with resources having JSON attributes, I'm thinking of creating `schema.TypeJSON` which would allow us to do the following:\r\n\r\n1. Have better/standardised/visible way of \"normalising\" the JSON for state\r\n2. Expanding from string to struct and flattening from struct to string could work out of the box or with minimal effort\r\n3. Be able to define default values for structures inside the JSON in a standardised way - typically to avoid situations where user doesn't provide these and API replies with different JSON (having defaults defined)\r\n4. Be able to set any part of the JSON structure as \"computed\" - which would work the same way as `schema.Schema.Computed = true`, but on a field level.\r\n\r\nFeedback is welcomed."},"comment":{"url":"https://api.github.com/repos/hashicorp/terraform/issues/comments/132459122","html_url":"https://github.com/hashicorp/terraform/issues/3014#issuecomment-132459122","issue_url":"https://api.github.com/repos/hashicorp/terraform/issues/3014","id":132459122,"user":{"login":"radeksimko","id":287584,"avatar_url":"https://avatars.githubusercontent.com/u/287584?v=3","gravatar_id":"","url":"https://api.github.com/users/radeksimko","html_url":"https://github.com/radeksimko","followers_url":"https://api.github.com/users/radeksimko/followers","following_url":"https://api.github.com/users/radeksimko/following{/other_user}","gists_url":"https://api.github.com/users/radeksimko/gists{/gist_id}","starred_url":"https://api.github.com/users/radeksimko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/radeksimko/subscriptions","organizations_url":"https://api.github.com/users/radeksimko/orgs","repos_url":"https://api.github.com/users/radeksimko/repos","events_url":"https://api.github.com/users/radeksimko/events{/privacy}","received_events_url":"https://api.github.com/users/radeksimko/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T06:17:55Z","updated_at":"2015-08-19T06:17:55Z","body":"Nice! it doesn't have that logic for nested attributes - setting default values or marking as computed, but that could be part of another PR."}}