Sha256: 5c10a8cd2f9c37e39a2afc9ab47f447f4b7e49d730f07a2f6419944de524fc17
Contents?: true
Size: 520 Bytes
Versions: 14
Compression:
Stored size: 520 Bytes
Contents
module Fakeit module Openapi class << self def load(src) parse_method = parse_method(src) open(src, &:read) .then(&parse_method) .then(&OpenAPIParser.method(:parse)) end private def parse_method(src) case File.extname(src) when '.json' JSON.method(:parse) when '.yml', '.yaml' YAML.method(:safe_load) else raise 'Invalid openapi specification file' end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems