Sha256: 4af28c4f2507a9af333c9b7c4acbf42f1ca0173709c9de610ad14fafa75aa5f3

Contents?: true

Size: 1.28 KB

Versions: 17

Compression:

Stored size: 1.28 KB

Contents

# frozen_string_literal: true

require_relative 'spec_media_types'

Praxis::ApiDefinition.define do
  trait :test do
    description 'testing trait'
  end
end

class PeopleResource
  include Praxis::EndpointDefinition

  description 'People resource'

  media_type Person

  version '1.0'

  canonical_path :show

  trait :test

  prefix '/people'

  action :index do
    enable_large_params_proxy_action at: '/some/custom/path'
    description 'index description'
    routing do
      get ''
    end
    params do
      attribute :filters, String
    end
  end

  action :show do
    enable_large_params_proxy_action # Create an equivalent action named 'show_with_post' with the payload matching this action's parameters (except :id)
    description 'show description'
    routing do
      get '/:id'
    end
    params do
      attribute :id, Integer, required: true
    end
  end
end

class AddressResource
  include Praxis::EndpointDefinition

  description 'Address resource'

  media_type Address

  version '1.0'

  prefix '/addresses'

  action :index do
    description 'index description'
    routing do
      get ''
    end
  end

  action :show do
    description 'show description'
    routing do
      get '/:id'
    end
    params do
      attribute :id, Integer, required: true
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
praxis-2.0.0 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.40 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.39 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.38 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.37 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.36 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.35 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.34 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.33 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.32 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.31 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.30 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.29 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.28 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.27 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.26 spec/support/spec_endpoint_definitions.rb
praxis-2.0.pre.25 spec/support/spec_endpoint_definitions.rb