Sha256: 53a96a81314c1b22cf9279786e62411b500fd110b553e29c6e91da1adc84b7b4

Contents?: true

Size: 817 Bytes

Versions: 8

Compression:

Stored size: 817 Bytes

Contents

# Use this file to define your overall api behavior, response templates and traits.
Praxis::ApiDefinition.define do
  info do
    name 'example'
    title 'Example API'

    # Attributes for OpenAPI docs
    termsOfService 'https://mysitehere.com'
    contact name: 'API Info', email: 'info@mysitehere.com'
    server(
      url: 'https://{host}',
      description: 'My Fancy API Service',
      variables: {
        host: {
          default: 'localhost',
          description: 'Host environment where to point at',
          enum: %w[localhost mysitehere.com],
        },
      },
    )
  end
  
  # Trait that when included will require a Bearer authorization header to be passed in.
  trait :authorized do
    headers do
      key "Authorization", String, regexp: /^.*Bearer\s/, required: true
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
praxis-2.0.0 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.40 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.39 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.38 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.37 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.36 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.35 tasks/thor/templates/generator/example_app/design/api.rb
praxis-2.0.pre.34 tasks/thor/templates/generator/example_app/design/api.rb