Sha256: c9d81608db9ceee251bc78b8d3944f1d3d3f8815abe03ab89cb531914f5d0567

Contents?: true

Size: 649 Bytes

Versions: 10

Compression:

Stored size: 649 Bytes

Contents

resource :products do
  collection do
    post :create do
      schema :product, :for => [:payload, :response]
    end

    get :index do
      schema :product, :for => [:response], :without => [:category]
    end
  end

  member do
    url_param(:id) { schema_id(:product) }

    get :show
    put :update
    delete(:destroy) { no_schema }
  end
end

resource :categories do
  schema :category

  collection do
    post :create
    get :index
  end

  member do
    url_param(:id) { schema_id(:category) }

    get :show
    put :update
    delete(:destroy) { no_schema }

    get :products, '/products' do
      schema :product
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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