Sha256: 0320804465646db65e7393a826e564d749379107d6629819173bb0e1bffda949
Contents?: true
Size: 805 Bytes
Versions: 7
Compression:
Stored size: 805 Bytes
Contents
module SoberSwag module Reporting module Input ## # Specify that something must match a particular format. # Note: said format is just a string. class Format < Base def initialize(input, format) @input = input @format = format end ## # @return [Interface] attr_reader :input ## # @return [String] attr_reader :format def call(object) input.call(object) end def swagger_schema schema, found = input.swagger_schema merged = if schema.key?(:$ref) { allOf: [schema] } else schema end.merge(format: format) [merged, found] end end end end end
Version data entries
7 entries across 7 versions & 1 rubygems