Sha256: a639014ac316dfed82d457d2144665c3082c73424030fe5102e3a38bc795e35e
Contents?: true
Size: 742 Bytes
Versions: 15
Compression:
Stored size: 742 Bytes
Contents
module OasParser class Definition include OasParser::RawAccessor raw_keys :info, :servers, :components, :openapi attr_accessor :raw def self.resolve(path) raw = Parser.resolve(path) Definition.new(raw) end def initialize(raw) @raw = raw end def paths raw['paths'].map do |path, definition| OasParser::Path.new(self, path, definition) end end def path_by_path(path) definition = raw['paths'][path] raise StandardError.new('So such path exists') unless definition OasParser::Path.new(self, path, definition) end def security raw['security'] || [] end def endpoints paths.flat_map(&:endpoints) end end end
Version data entries
15 entries across 15 versions & 1 rubygems