Sha256: 31f162a7eb9776785534fac54db9d66cfcccf8a2ecc9158461f9dcfba3ed98b6

Contents?: true

Size: 699 Bytes

Versions: 29

Compression:

Stored size: 699 Bytes

Contents

module OasParser
  class RequestBody < Payload
    include OasParser::RawAccessor
    raw_keys :description, :required, :content

    attr_accessor :endpoint, :raw

    def initialize(endpoint, raw)
      @endpoint = endpoint
      @raw = raw
    end

    def properties_for_format(format)
      schema(format)['properties'].map do |name, definition|
        OasParser::Property.new(self, schema(format), name, definition)
      end
    end

    def split_properties_for_format(format)
      split_schemas(format).map do |schema|
        schema['properties'].map do |name, definition|
          OasParser::Property.new(self, schema(format), name, definition)
        end
      end
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
oas_parser-0.7.0 lib/oas_parser/request_body.rb
oas_parser-0.6.0 lib/oas_parser/request_body.rb
oas_parser-0.5.0 lib/oas_parser/request_body.rb
oas_parser-0.4.0 lib/oas_parser/request_body.rb
oas_parser-0.3.0 lib/oas_parser/request_body.rb
oas_parser-0.2.0 lib/oas_parser/request_body.rb
oas_parser-0.1.2 lib/oas_parser/request_body.rb
oas_parser-0.1.1 lib/oas_parser/request_body.rb
oas_parser-0.1.0 lib/oas_parser/request_body.rb