class OasRails::Spec::Specification
def build(route_extractor: Extractors::RouteExtractor)
def build(route_extractor: Extractors::RouteExtractor) route_extractor.host_paths.each do |path| @paths.add_path(path) end end
def clear_cache
-
(void)
-
def clear_cache MethodSource.clear_cache Extractors::RouteExtractor.clear_cache end
def initialize
Initializes a new Specification object.
def initialize clear_cache unless Rails.env.production? @components = Components.new(self) @info = OasRails.config.info @openapi = '3.1.0' @servers = OasRails.config.servers @tags = OasRails.config.tags @external_docs = {} @paths = Spec::Paths.new(self) end
def oas_fields
def oas_fields [:openapi, :info, :servers, :paths, :components, :security, :tags, :external_docs] end
def security
- See: https://spec.openapis.org/oas/latest.html#security-requirement-object -
def security return [] unless OasRails.config.authenticate_all_routes_by_default OasRails.config.security_schemas.map { |key, _| { key => [] } } end