{"action":"created","issue":{"url":"https://api.github.com/repos/striglia/pyramid_swagger/issues/88","labels_url":"https://api.github.com/repos/striglia/pyramid_swagger/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/striglia/pyramid_swagger/issues/88/comments","events_url":"https://api.github.com/repos/striglia/pyramid_swagger/issues/88/events","html_url":"https://github.com/striglia/pyramid_swagger/pull/88","id":60281299,"number":88,"title":"Expose Validators instead of schemas and resolvers","user":{"login":"dnephin","id":442180,"avatar_url":"https://avatars.githubusercontent.com/u/442180?v=3","gravatar_id":"","url":"https://api.github.com/users/dnephin","html_url":"https://github.com/dnephin","followers_url":"https://api.github.com/users/dnephin/followers","following_url":"https://api.github.com/users/dnephin/following{/other_user}","gists_url":"https://api.github.com/users/dnephin/gists{/gist_id}","starred_url":"https://api.github.com/users/dnephin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnephin/subscriptions","organizations_url":"https://api.github.com/users/dnephin/orgs","repos_url":"https://api.github.com/users/dnephin/repos","events_url":"https://api.github.com/users/dnephin/events{/privacy}","received_events_url":"https://api.github.com/users/dnephin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-03-08T22:56:40Z","updated_at":"2015-03-21T18:41:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/striglia/pyramid_swagger/pulls/88","html_url":"https://github.com/striglia/pyramid_swagger/pull/88","diff_url":"https://github.com/striglia/pyramid_swagger/pull/88.diff","patch_url":"https://github.com/striglia/pyramid_swagger/pull/88.patch"},"body":"Resolves #1 - header validation\r\n\r\nAs I was working on #22 I noticed that I was having to frequently pass around a `resolver`, but that resolver was only ever going to be used with the `schema` that came from the same place.\r\n\r\nThis refactor exposes a `SchemaValidator` object instead of the the `SchemaAndResolver` object. The validator can be used directly to validate a field from the request or response, but it also stores the original schema which can be used to cast values.\r\n\r\nExposing a validator instead of the schema and resolver should allow us to make changes to the validator (as suggested by some TODOs added in this PR) in a single location (`load_schema`). Previously it would require changes to both `load_schema` and `tween`. \r\n\r\nI think it also makes the tween easier to reason about.  All of the validation logic is now part of the model/load_schema.  The tween only needs to iterate over the fields and validate each without worrying about the implementation of that validation."},"comment":{"url":"https://api.github.com/repos/striglia/pyramid_swagger/issues/comments/84416935","html_url":"https://github.com/striglia/pyramid_swagger/pull/88#issuecomment-84416935","issue_url":"https://api.github.com/repos/striglia/pyramid_swagger/issues/88","id":84416935,"user":{"login":"landscape-bot","id":10010231,"avatar_url":"https://avatars.githubusercontent.com/u/10010231?v=3","gravatar_id":"","url":"https://api.github.com/users/landscape-bot","html_url":"https://github.com/landscape-bot","followers_url":"https://api.github.com/users/landscape-bot/followers","following_url":"https://api.github.com/users/landscape-bot/following{/other_user}","gists_url":"https://api.github.com/users/landscape-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/landscape-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/landscape-bot/subscriptions","organizations_url":"https://api.github.com/users/landscape-bot/orgs","repos_url":"https://api.github.com/users/landscape-bot/repos","events_url":"https://api.github.com/users/landscape-bot/events{/privacy}","received_events_url":"https://api.github.com/users/landscape-bot/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T18:41:17Z","updated_at":"2015-03-21T18:41:17Z","body":"[![Code Health](https://landscape.io/badge/130035/landscape.svg?style=flat)](https://landscape.io/diff/116017)\nCode quality remained the same when pulling **[f436091](https://github.com/dnephin/pyramid_swagger/commit/f436091a84450b2e790a22a953ed638edc195334) on dnephin:refactor_model** into **[e57b344](https://github.com/striglia/pyramid_swagger/commit/e57b344272766e49dcb89c66fe5e1a878733fa50) on striglia:master**."}}