mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-22 22:06:50 +00:00
It is a common pattern to use JSON Schema to validate a API response[1], [2] and [3]. This patch creates the `assert_response_schema` test helper that helps people do this kind of validation easily on the controller tests. [1]: https://robots.thoughtbot.com/validating-json-schemas-with-an-rspec-matcher [2]: https://github.com/sharethrough/json-schema-rspec [3]: https://github.com/rails-api/active_model_serializers/issues/1011#issuecomment-127608121
11 lines
195 B
JSON
11 lines
195 B
JSON
{
|
|
"properties": {
|
|
"name": {
|
|
"$ref": "file://custom/show.json#/properties/name"
|
|
},
|
|
"description": {
|
|
"$ref": "file://custom/show.json#/properties/description"
|
|
}
|
|
}
|
|
}
|