class R2OAS::Schema::V3::PathGenerator
Public Class Methods
new(schema_data = {}, options = {})
click to toggle source
Calls superclass method
R2OAS::Schema::V3::BaseGenerator::new
# File lib/r2-oas/schema/v3/generator/path_generator.rb, line 12 def initialize(schema_data = {}, options = {}) super(options) sorted_schema_data = deep_sort(schema_data, 'paths') @paths = sorted_schema_data['paths'] @glob_schema_paths = create_glob_paths_paths end
Public Instance Methods
generate_docs()
click to toggle source
# File lib/r2-oas/schema/v3/generator/path_generator.rb, line 19 def generate_docs logger.info ' <From routes data>' generate_docs_from_routes_data end
Private Instance Methods
create_glob_paths_paths()
click to toggle source
# File lib/r2-oas/schema/v3/generator/path_generator.rb, line 46 def create_glob_paths_paths if many_paths_file_paths.present? && !skip_load_dot_paths many_paths_file_paths else ["#{schema_save_dir_path}/paths/**/**.yml"] end end
generate_docs_from_routes_data()
click to toggle source
# File lib/r2-oas/schema/v3/generator/path_generator.rb, line 28 def generate_docs_from_routes_data process_when_generate_docs do |save_file_path| logger.info " Add schema file into store: \t#{save_file_path}" end end
process_when_generate_docs() { |save_file_path| ... }
click to toggle source
# File lib/r2-oas/schema/v3/generator/path_generator.rb, line 34 def process_when_generate_docs logger.info ' <Update schema files (paths)>' save_each_tags(@paths) do |tag_name, result| relative_path = "paths/#{tag_name}" file_manager = PathItemFileManager.new(relative_path, :relative) save_file_path = file_manager.save_file_path(type: :relative) store.add(save_file_path, result.to_yaml) yield save_file_path if block_given? end end