class R2OAS::Schema::V3::PathAnalyzer
Constants
- NOT_VERB
- VERB
Public Class Methods
new(before_schema_data, after_schema_data, options = {})
click to toggle source
Calls superclass method
R2OAS::Schema::V3::BaseAnalyzer::new
# File lib/r2-oas/schema/v3/analyzer/path_analyzer.rb, line 16 def initialize(before_schema_data, after_schema_data, options = {}) super @tags = [] end
Public Instance Methods
analyze_docs()
click to toggle source
# File lib/r2-oas/schema/v3/analyzer/path_analyzer.rb, line 21 def analyze_docs sorted_schema = deep_sort(@after_schema_data, 'paths') edited_paths_schema = sorted_schema['paths'] save_each_tags(edited_paths_schema) do |tag_name, result| file_manager = PathItemFileManager.new("paths/#{tag_name}", :relative) file_manager.save(result.to_yaml) logger.info " Write schema file: \t#{file_manager.save_file_path(type: :relative)}" end # Automatically generated when there is no tag object in the read schema file if generate_tag_file? result = { 'tags' => V3::TagObject.new(@tags).to_doc } file_manager = FileManager.new('tags', :relative) file_manager.save(result.to_yaml) end end
Private Instance Methods
generate_tag_file?()
click to toggle source
# File lib/r2-oas/schema/v3/analyzer/path_analyzer.rb, line 41 def generate_tag_file? !@after_schema_data.keys.include?('tags') end