Using JSON Schema to Document, Test, and Debug APIs
In the Platform API’s test suite, we use the committee gem to see that JSON responses from our API match the structure of the corresponding JSON Schema files. If the test for an endpoint passes the method provided by the committee gem, we know that our API requests and responses match the definitions in JSON Schema. To prevent Oj from casting BigDecimals as strings, we updated our app’s MultiJson config to:
And when I re-ran the test for a team with a BigDecimal value, it passed, so I knew that our schema, and therefore our docs, were reflecting the real returned values from our API.
Source: blog.heroku.com