Sha256: cbf67357e377bff79638c3b06597f31d98737320479a891e65cbaf67abb79af3

Contents?: true

Size: 459 Bytes

Versions: 10

Compression:

Stored size: 459 Bytes

Contents

mixin :timestamps do
  attribute :created_at, datetime, :for => [:response]
  attribute :updated_at, datetime, :for => [:response]
end

schema :product do
  include_attributes :timestamps

  attribute :name, string
  attribute :code, string
  attribute :price, decimal | decimal_string
  attribute :category_id, schema_id(:category)
  attribute :category, embedded_schema(:category), :for => [:response]
end

schema :category do
  attribute :name, string
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
restspec-0.3.2 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.3.1 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.3.0 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2.6 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2.5 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2.4 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2.3 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2.2 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2.1 examples/store-api-tests/spec/api/restspec/schemas.rb
restspec-0.2 examples/store-api-tests/spec/api/restspec/schemas.rb