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.20.0 lib/oas_parser/request_body.rb
oas_parser-0.19.0 lib/oas_parser/request_body.rb
oas_parser-0.18.2 lib/oas_parser/request_body.rb
oas_parser-0.18.1 lib/oas_parser/request_body.rb
oas_parser-0.18.0 lib/oas_parser/request_body.rb
oas_parser-0.17.0 lib/oas_parser/request_body.rb
oas_parser-0.16.0 lib/oas_parser/request_body.rb
oas_parser-0.15.2 lib/oas_parser/request_body.rb
oas_parser-0.15.1 lib/oas_parser/request_body.rb
oas_parser-0.15.0 lib/oas_parser/request_body.rb
oas_parser-0.14.0 lib/oas_parser/request_body.rb
oas_parser-0.13.1 lib/oas_parser/request_body.rb
oas_parser-0.12.0 lib/oas_parser/request_body.rb
oas_parser-0.11.2 lib/oas_parser/request_body.rb
oas_parser-0.11.1 lib/oas_parser/request_body.rb
oas_parser-0.11.0 lib/oas_parser/request_body.rb
oas_parser-0.10.0 lib/oas_parser/request_body.rb
oas_parser-0.9.0 lib/oas_parser/request_body.rb
oas_parser-0.8.1 lib/oas_parser/request_body.rb
oas_parser-0.8.0 lib/oas_parser/request_body.rb