how can I test these in a schema ?

44 views
Skip to first unread message

r/ Wobben

unread,
Jul 5, 2016, 3:04:31 AM7/5/16
to Ruby JSON Schema Library
Hello,

I have a json api where a user enters data so a financial account is made.

Now there are 2 validation rules.

name must be a string
category must be one of these items :  [ 'Bezittingen langer dan 1 jaar', 'Bezittingen korter dan 1 jaar', 'Schulden langer dan 1 jaar', 'Schulden korter dan 1 jaar','Kas/Bank', 'Opbrengsten', 'Kosten', 'Tussenrekeningen']

how can I make a schema which test like this.
second question : what do I use here :  JSON::Validator.validate(schema, xxxxx) ?


Reply all
Reply to author
Forward
0 new messages