Sha256: aa81f1a2c24a40890df1ba075dbe245b755e3d25061327a85f46289c5d7669fe

Contents?: true

Size: 1001 Bytes

Versions: 2

Compression:

Stored size: 1001 Bytes

Contents

require 'swagger/swagger_object'

module Swagger
  module V2
    # Class representing a Swagger "Parameter Object".
    # @see https://github.com/wordnik/swagger-spec/blob/master/versions/2.0.md#parameterObject Parameter Object
    class Parameter < SwaggerObject
      # @!group Fixed Fields
      #required_field :name, String
      # required_field :in, String
      field :name, String
      field :in, String
      field :description, String
      field :required, Swagger::Boolean
      alias_method :required?, :required
      # @!endgroup

      # @!group Body Fields
      field :schema, Schema
      # @!endgroup

      # @!group Non-Body Fields
      field :type, String
      field :format, String
      field :items, Hash # TODO: Items Object
      field :collectionFormat, String
      field :default, Object
      field :allowEmptyValue, Swagger::Boolean
      alias_method :allowEmptyValue?, :allowEmptyValue
      # @!endgroup

      include DeterministicJSONSchema
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
swagger-parser-0.2.6 lib/swagger/v2/parameter.rb
swagger-parser-0.2.5 lib/swagger/v2/parameter.rb