Skip to content

Instantly share code, notes, and snippets.

@alex-ethier
Created July 4, 2014 01:47
Show Gist options
  • Save alex-ethier/6ff2ab8014ad206c41c2 to your computer and use it in GitHub Desktop.
Save alex-ethier/6ff2ab8014ad206c41c2 to your computer and use it in GitHub Desktop.
Schema Validation
-define(TEST_PAYLOAD_HTTP_JSON, <<"{\"version\": \"0.0.1\", \"description\": \"cookbook update\", \"notification_type\": \"http\", \"timestamp\": \"2014-06-05T10:52Z\", \"delivery_options\": {\"url\": \"http://blah.com/updates\"}, \"type\": \"notification\", \"id\": \"04ab8499-0188-11e4-a7f5-8438354265f6\", \"data\": {\"organization_name\": \"foobarorg\", \"requestor_type\": \"user\", \"task\": \"update\", \"parent_name\": \"redis\", \"entity_name\": \"2.3.1\", \"recorded_at\": \"timestamp\", \"parent_type\": \"cookbook\", \"entity_type\": \"version\", \"requestor_name\": \"fooman\"}}">>).
-define(TEST_PAYLOAD_HTTP, {[{<<"type">>, <<"notification">>},
{<<"version">>, <<"0.0.1">>},
{<<"id">>, <<"04ab8499-0188-11e4-a7f5-8438354265f6">>},
{<<"timestamp">>, <<"2014-06-05T10:52Z">>},
{<<"notification_type">>, <<"http">>},
{<<"description">>, <<"cookbook update">>},
{<<"data">>, {[{<<"organization_name">>, "foobarorg"},
{<<"requestor_type">>, "user"},
{<<"requestor_name">>, "fooman"},
{<<"recorded_at">>, "timestamp"},
{<<"task">>, "update"},
{<<"entity_type">>, "version"},
{<<"entity_name">>, "2.3.1"},
{<<"parent_type">>, "cookbook"},
{<<"parent_name">>, "redis"}]}},
{<<"delivery_options">>, {[{<<"url">>,<<"http://blah.com/updates">>}]}}]}).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment