Sha256: 4ac05b0dcfcccf5fd8ac64cb010358fd988c9d84c499bfcb09326d7cc51ec9a9

Contents?: true

Size: 763 Bytes

Versions: 1

Compression:

Stored size: 763 Bytes

Contents

# match-json-schema[![CircleCI](https://circleci.com/gh/taki/match-json-schema.svg?style=svg)](https://circleci.com/gh/taki/match-json-schema)

match_json_schema compliant with JSON Schema Draft 4.

## Usage

```ruby
RSpec.describe UsersController, type: :controller do
  describe 'GET #show' do
    let(:user) { User.create!(name: :kurou) }

    specify do
      get :show, params: {id: user.id, format: :json}

      schema = {
        type: :object,
        required: %i(id name created_at updated_at),
        properties: {
          id: {type: :integer},
          name: {type: :string},
          created_at: {type: :string},
          updated_at: {type: :string}
        }
      }

      expect(response).to match_json_schema(schema)
    end
  end
end
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
match-json-schema-0.2.1 README.md