Analyzer::Specification::SpecificationEngine
Inherits Analyzer < FileHelper < Reference < Object
Base for the specification-format analyzers (OpenAPI, Postman, HAR, Terraform, k8s manifests, proxy exports, …).
They do not walk the file tree the way the language engines do. The
detector recognises a document and pushes its path into CodeLocator
under a key, and the analyzer later drains that key. Forty-odd
analyzers each open-coded the same drain:
locator = CodeLocator.instance
files = locator.all(Noir::LocatorKeys::OAS3_JSON)
return @result unless files.is_a?(Array(String))
files.each do |path|
next unless File.exists?(path)
begin
...
rescue e
@logger.debug "..."
@logger.debug_sub e
end
end
with just enough variation between copies that some dropped the
existence check, some dropped the per-file rescue (letting one
malformed document abort every remaining file for that analyzer), and
the log wording differed everywhere. each_spec_file is that drain,
once.
Constants
scheme:// prefix of an absolute URL. //host/path is deliberately not
matched here — it is protocol-relative and handled separately.
scheme://host/… and protocol-relative //host/… ref targets.