Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema validation and test against aeson instances #12

Closed
fizruk opened this issue Nov 25, 2015 · 0 comments
Closed

Schema validation and test against aeson instances #12

fizruk opened this issue Nov 25, 2015 · 0 comments

Comments

@fizruk
Copy link
Member

fizruk commented Nov 25, 2015

It should be straightforward to implement validation:

validate :: Schema -> Value -> Maybe ErrorMsg

Given that we should add tests for compliance with aeson's ToJSON instances:

testAeson :: forall a. (Arbitrary a, ToJSON a, ToSchema a) => Spec ()
testAeson = prop "toSchema is compliant with toJSON" $ \(x :: a) ->
  validate (toSchema (Proxy :: Proxy a)) (toJSON a) == Nothing
@fizruk fizruk closed this as completed in #18 Feb 1, 2016
fizruk referenced this issue Feb 1, 2016
JSON validation based on Swagger Schema
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant