Sha256: ce8ee0b7e6faf8e16633221f14ebf1b3c28c51cac39f939bb570fe70b691bf12

Contents?: true

Size: 499 Bytes

Versions: 1

Compression:

Stored size: 499 Bytes

Contents

require 'swagger/v2/example'

module Swagger
  module V2
    class Response < DefinitionSection
      section :description, String
      section :schema, Swagger::Schema
      section :headers, Array # [String => String] # TODO: Headers
      section :examples, Hash[Swagger::MimeType => Example]

      def status_code
        code = parent.responses.key self
        code = '200' if code == 'default'
        code.to_i
      rescue
        # TODO: Warning?
        200
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
swagger-core-0.2.0 lib/swagger/v2/response.rb