class

Detector::Specification::Oas2

Inherits Detector < Reference < Object

Constants

SWAGGER2_JSON_MARKER = /"swagger"[ \t]*:[ \t]*"2\./
SWAGGER2_YAML_MARKER = /^["']?swagger["']?[ \t]*:[ \t]*["']?2\./m

See Detector::Specification::Oas3 for why the YAML gate is anchored at column 0 and stands in for the parse. A bare /swagger/ matched every OpenAPI 3 document that links to its own swagger.yaml origin — 67 of the 493 openapi-directory documents in the perf corpus — and each one paid for a full YAML parse only to be rejected.

Instance methods

applicable?(filename : String) : Bool

Registers every OAS2 spec path in CodeLocator for the analyzer pass. Must keep running after first match.

Source
detect(filename : String, file_contents : String) : Bool
Source
idempotent?

Registers every OAS2 spec path in CodeLocator for the analyzer pass. Must keep running after first match.

Source
name

Registers every OAS2 spec path in CodeLocator for the analyzer pass. Must keep running after first match.

Source