class SoberSwag::Reporting::Input::Described

Node for things with descriptions. This describes the type, not the *object key*.

Attributes

description[R]

@return [String] description of input

input[R]

@return [Interface] base input

Public Class Methods

new(input, description) click to toggle source
# File lib/sober_swag/reporting/input/described.rb, line 8
def initialize(input, description)
  @input = input
  @description = description
end

Public Instance Methods

call(value) click to toggle source
# File lib/sober_swag/reporting/input/described.rb, line 21
def call(value)
  input.call(value)
end
swagger_schema() click to toggle source
# File lib/sober_swag/reporting/input/described.rb, line 25
def swagger_schema
  val, other = input.swagger_schema
  merged =
    if val.key?(:$ref)
      { allOf: [val] }
    else
      val
    end.merge(description: description)
  [merged, other]
end