Sha256: 7fd536a662dc2a236e2c8b59aa41a69a5bbad8c32c951b698c6edc9519cb9e55

Contents?: true

Size: 661 Bytes

Versions: 5

Compression:

Stored size: 661 Bytes

Contents

# frozen_string_literal: true

require 'oas_objs/helpers'

module OpenApi
  module DSL
    # https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md#header-object
    class HeaderObj < Hash
      include Helpers

      attr_accessor :processed, :schema

      def initialize(desc = '', schema)
        self.schema = SchemaObj.new(schema)
        self.processed = { description: desc }
      end

      def process
        processed.merge!(schema: schema.process)
      end
    end
  end
end


__END__

Header Object Example

{
  "description": "The number of allowed requests in the current period",
  "schema": {
    "type": "integer"
  }
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
zero-rails_openapi-2.2.0 lib/oas_objs/header_obj.rb
zero-rails_openapi-2.1.5 lib/oas_objs/header_obj.rb
zero-rails_openapi-2.1.4 lib/oas_objs/header_obj.rb
zero-rails_openapi-2.1.3 lib/oas_objs/header_obj.rb
zero-rails_openapi-2.1.2 lib/oas_objs/header_obj.rb