{"action":"closed","issue":{"url":"https://api.github.com/repos/viewthespace/shapeable/issues/10","repository_url":"https://api.github.com/repos/viewthespace/shapeable","labels_url":"https://api.github.com/repos/viewthespace/shapeable/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/viewthespace/shapeable/issues/10/comments","events_url":"https://api.github.com/repos/viewthespace/shapeable/issues/10/events","html_url":"https://github.com/viewthespace/shapeable/issues/10","id":147156563,"number":10,"title":"Versioning should be optional, and other problems with opinianated defaults.","user":{"login":"dnasseri","id":8558194,"avatar_url":"https://avatars.githubusercontent.com/u/8558194?v=3","gravatar_id":"","url":"https://api.github.com/users/dnasseri","html_url":"https://github.com/dnasseri","followers_url":"https://api.github.com/users/dnasseri/followers","following_url":"https://api.github.com/users/dnasseri/following{/other_user}","gists_url":"https://api.github.com/users/dnasseri/gists{/gist_id}","starred_url":"https://api.github.com/users/dnasseri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnasseri/subscriptions","organizations_url":"https://api.github.com/users/dnasseri/orgs","repos_url":"https://api.github.com/users/dnasseri/repos","events_url":"https://api.github.com/users/dnasseri/events{/privacy}","received_events_url":"https://api.github.com/users/dnasseri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-09T19:29:27Z","updated_at":"2016-04-14T19:14:17Z","closed_at":"2016-04-14T19:14:17Z","body":"Shapeable now supports default shape and default version arguments. These arguments are optional. In the case where no headers are sent, and no defaults are given we raise an `UnresovledShapeError`. On the one hand, this is good, because we want to be explicit when a client sends a request that shapeable cant handle. On the other hand, the way we have it implemented currently, it means that the following shape is not possible (assume path is `Serializers::Foo`): \r\n\r\n`Serializers::Foo::FooFullSerializer`\r\n\r\nWe should give users the option to use unversioned shapes.\r\n\r\nFurthermore, when using shapeable, in order to have the following shape:\r\n\r\n`Serializers::Foo::V1::FooSerializer`\r\n\r\nWe have to specify a `default_shape` of `''` (empty string), which seems a bit wonky. Maybe adding another option such as `coerce: true` would allow us to simply generate `FooSerializer` constant when no default_shape is given.\r\n\r\nI also really like @dubilla suggestion of being able to pass a block to shape which would generate the serializer constant.\r\n\r\nWe have not set up configuration yet, but I think a config option of `log_level`, which, depending on the level, would log when a shape was created using the default, or when a shape was coerced could be very valuable.\r\n\r\nFinally, we should update the README with examples of what constants are generated when passing certain combinations of headers and defaults."}}