Sha256: 50b1b619403cb7fbdcae8e6ffb1660f6255ce3290419dd7077f2846eb75e6ca6

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

# frozen_string_literal: true

module ApiResources
  class Authors
    include Praxis::EndpointDefinition

    media_type Author
    version '1.0'

    action :index do
      routing { get '' }
      params do
        attribute :fields, Praxis::Types::FieldSelector.for(Author), description: 'Fields with which to render the result.'
        attribute :filters, Praxis::Types::FilteringParams.for(Author) # No block for allowing any filtering
        attribute :order, Praxis::Extensions::Pagination::OrderingParams.for(Author) # No block for allowing any sorting
        attribute :pagination, Praxis::Types::PaginationParams.for(Author) # No block for allowing any field pagination
      end
      response :ok, media_type: Praxis::Collection.of(Author)
    end

    action :show do
      routing { get '/:id' }

      params do
        attribute :id, description: 'ID to find'
        attribute :fields, Praxis::Types::FieldSelector.for(Author), description: 'Fields with which to render the result.'
      end
      response :ok
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
praxis-2.0.0 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.40 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.39 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.38 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.37 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.36 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.35 spec/spec_app/design/resources/authors.rb
praxis-2.0.pre.34 spec/spec_app/design/resources/authors.rb