Skip to content

Commit

Permalink
Merge pull request #56 from hornc/master
Browse files Browse the repository at this point in the history
add custom schema validation info to readme
  • Loading branch information
hornc committed Aug 3, 2015
2 parents 7b40ca1 + 4125f35 commit ada2d77
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,15 @@ expect(subject).to validate(
)
```

Your Swagger.json can be validated against additional custom schemata, for example to enforce organisation API documentation standards, by using the following syntax:

```ruby
it 'additionally conforms to a custom schema' do
expect(subject).to conform_to("<your custom schema>.json")
end
```
We have included an example [here] (data/custom_schemata/westfield_api_standards.json). The file path to this custom schema is stored in `Apivore::CustomSchemaValidator::WF_SCHEMA`, if you wish to use it.

Run the tests as part of your normal rspec test suite, e.g., `rake spec:requests`

## Useful Resources
Expand Down

0 comments on commit ada2d77

Please sign in to comment.