Sha256: 4aea6fa13eac6443fba089a5f2a4ae72ca4531ceea12ba8362e84a0737f82439

Contents?: true

Size: 1.63 KB

Versions: 9

Compression:

Stored size: 1.63 KB

Contents

# frozen_string_literal: true

require 'rspec/rails/api/dsl/example_group'
require 'rspec/rails/api/dsl/example'
require 'rspec/rails/api/entity_config'
require 'rspec/rails/api/field_config'
require 'rspec/rails/api/matchers'
require 'rspec/rails/api/metadata'
require 'rspec/rails/api/open_api_renderer'
require 'rspec/rails/api/version'

module RSpec
  module Rails
    module Api
      class Error < StandardError
      end

      ##
      # OpenAPI types, format and Ruby class correspondence
      PARAM_TYPES = {
        int32:    { type: 'integer', format: 'int32', class: Integer },
        int64:    { type: 'integer', format: 'int64', class: Integer },
        float:    { type: 'number', format: 'float', class: Float },
        double:   { type: 'number', format: 'double', class: Float },
        byte:     { type: 'string', format: 'byte', class: String },
        binary:   { type: 'string', format: 'binary', class: String },
        date:     { type: 'string', format: 'date', class: String },
        datetime: { type: 'string', format: 'date-time', class: String },
        password: { type: 'string', format: 'password', class: String },
        boolean:  { type: 'boolean', format: nil },
        string:   { type: 'string', format: nil, class: String },
        integer:  { type: 'integer', format: nil, class: Integer },
        number:   { type: 'number', format: nil, class: Numeric },
        array:    { type: 'array', format: nil, class: Array },
        object:   { type: 'object', format: nil, class: Hash },
        file:     { type: 'string', format: 'binary' },
      }.freeze

      PRIMITIVES = PARAM_TYPES.keys
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rspec-rails-api-0.8.3 lib/rspec_rails_api.rb
rspec-rails-api-0.8.2 lib/rspec_rails_api.rb
rspec-rails-api-0.8.1 lib/rspec_rails_api.rb
rspec-rails-api-0.8.0 lib/rspec_rails_api.rb
rspec-rails-api-0.7.0 lib/rspec_rails_api.rb
rspec-rails-api-0.6.3 lib/rspec_rails_api.rb
rspec-rails-api-0.6.2 lib/rspec_rails_api.rb
rspec-rails-api-0.6.1 lib/rspec_rails_api.rb
rspec-rails-api-0.6.0 lib/rspec_rails_api.rb