Detector::Specification::Oas3
Constants
JSON gets no such structural guarantee — "openapi": "3.0.0" can sit
nested inside a wrapper document — so the JSON branch keeps parsing and
checking the root key, and the regex only serves as a cheap pre-gate.
Every .json/.yaml/.yml in the tree reaches this gate. A bare
/openapi/ matched any document that merely mentions OpenAPI — an
x-origin: {url: .../openapi.yaml} block, a description, a swagger
document that links to its own OAS3 conversion — and each of those paid
for a full YAML/JSON parse before being rejected.
In YAML a key at column 0 is a root key: a block scalar's content must be
indented past the key that introduces it, so an openapi: 3.x line
starting at column 0 cannot be anything but the document's version field.
That makes the anchored match as strong as the parse it replaces, so the
YAML branch registers on the regex alone and lets the analyzer — which
parses the document anyway — be the one that reads it. Previously every
OpenAPI document in the tree was parsed twice: once to decide, once to
analyze, with the first parse thrown away.
Class methods
The tech name without needing an instance, so the registry can be read off the classes themselves rather than from a parallel list.
Instance methods
Registers every OAS3 spec path in CodeLocator for the
analyzer pass. Must keep running after first match.
Registers every OAS3 spec path in CodeLocator for the
analyzer pass. Must keep running after first match.
Registers every OAS3 spec path in CodeLocator for the
analyzer pass. Must keep running after first match.