Sha256: 5c4c438cc317a65bcdb282513faa36c301e8174b9733b322f7764a20efc8e449

Contents?: true

Size: 689 Bytes

Versions: 15

Compression:

Stored size: 689 Bytes

Contents

# Schemas DSL

## Top Level DSL

### schema

The `schema` method creates a schema with a name and yields a schema dsl.

```ruby
schema :book do
end
```

## Schema DSL

### attribute

The `attribute` method create an attribute inside a `schema`. Actually, a schema is a collection of attributes.

```ruby
schema :book do
  attribute :title, string
end
```

### Type methods

The type methods are shortcuts to create type declarations that decide how an attribute should generate examples and how the attribute can be validated  against a value. For more information for each one of them, please see the [types documentation](https://github.com/platanus/restspec/blob/master/docs/types.md).

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
restspec-0.3.2 guides/schemas.md
restspec-0.3.1 guides/schemas.md
restspec-0.3.0 guides/schemas.md
restspec-0.2.6 guides/schemas.md
restspec-0.2.5 guides/schemas.md
restspec-0.2.4 guides/schemas.md
restspec-0.2.3 guides/schemas.md
restspec-0.2.2 guides/schemas.md
restspec-0.2.1 guides/schemas.md
restspec-0.2 guides/schemas.md
restspec-0.1 guides/schemas.md
restspec-0.0.4 docs/schemas.md
restspec-0.0.3 docs/schemas.md
restspec-0.0.2 docs/schemas.md
restspec-0.0.1 docs/schemas.md